René's URL Explorer Experiment


Title: T-17170 Flush after each RQ job and start forked children with a clean handler by PetrHeinz · Pull Request #47 · logtail/logtail-python · GitHub

Open Graph Title: T-17170 Flush after each RQ job and start forked children with a clean handler by PetrHeinz · Pull Request #47 · logtail/logtail-python

X Title: T-17170 Flush after each RQ job and start forked children with a clean handler by PetrHeinz · Pull Request #47 · logtail/logtail-python

Description: RQ runs every job in a forked work horse that ends with os._exit(), which skips the interpreter shutdown that normally lets the handler send what it has buffered. A job that finishes within the flush interval therefore loses all of its records. That is the pattern in #36: the long-lived worker's own rq.worker lines arrive, the job's own lines do not. Two changes, tests first (the first commit is expected to fail CI): logtail.rq.Worker flushes every LogtailHandler after each job, inside the work horse, before RQ exits it. Use it with rq worker --worker-class logtail.rq.Worker, or RQ = {"WORKER_CLASS": "logtail.rq.Worker"} with django-rq. rq stays out of the package's dependencies, the module only imports it when used. A forked child now starts with a fresh queue, no flush thread and a new HTTP session. Until now it inherited the parent's queue, so once the child flushes it would re-send whatever the parent still had buffered at fork time, a thread object whose thread does not exist in the child, and a requests.Session whose socket it shared with the parent. 🤖 Generated with Claude Code

Open Graph Description: RQ runs every job in a forked work horse that ends with os._exit(), which skips the interpreter shutdown that normally lets the handler send what it has buffered. A job that finishes within the flu...

X Description: RQ runs every job in a forked work horse that ends with os._exit(), which skips the interpreter shutdown that normally lets the handler send what it has buffered. A job that finishes within the flu...

Opengraph URL: https://github.com/logtail/logtail-python/pull/47

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:1f831745-0085-70fe-49f5-5949a018c755
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA874:F3916:F8AA9:158219:6AFBB9AE
html-safe-noncea0cf653599cab40d5f7644ebfc2e60abd23d809bf366c17307ffaa7870714fa8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODc0OkYzOTE2OkY4QUE5OjE1ODIxOTo2QUZCQjlBRSIsInZpc2l0b3JfaWQiOiIyNjYxMDQ0Njg3NjUyNzY0MDc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaccdd37429444da0dca46279995f2b5191934964ddd092625de79f72e67a17649c
hovercard-subject-tagpull_request:4614822699
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/logtail/logtail-python/pull/47/files
twitter:imagehttps://avatars.githubusercontent.com/u/10008612?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10008612?s=400&v=4
og:image:altRQ runs every job in a forked work horse that ends with os._exit(), which skips the interpreter shutdown that normally lets the handler send what it has buffered. A job that finishes within the flu...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/logtail/logtail-python git https://github.com/logtail/logtail-python.git
octolytics-dimension-user_id78922349
octolytics-dimension-user_loginlogtail
octolytics-dimension-repository_id351343852
octolytics-dimension-repository_nwologtail/logtail-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id351343852
octolytics-dimension-repository_network_root_nwologtail/logtail-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee4cce0e99cf61481a318ff12c2e8580153a6c7c6
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/logtail/logtail-python/pull/47/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flogtail%2Flogtail-python%2Fpull%2F47%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flogtail%2Flogtail-python%2Fpull%2F47%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=logtail%2Flogtail-python
Reloadhttps://github.com/logtail/logtail-python/pull/47/files
Reloadhttps://github.com/logtail/logtail-python/pull/47/files
Reloadhttps://github.com/logtail/logtail-python/pull/47/files
logtailhttps://github.com/logtail
logtail-pythonhttps://github.com/logtail/logtail-python
Codehttps://github.com/logtail/logtail-python
Issues1 (1)https://github.com/logtail/logtail-python/issues
Pull requestshttps://github.com/logtail/logtail-python/pulls
Actionshttps://github.com/logtail/logtail-python/actions
Security and qualityhttps://github.com/logtail/logtail-python/security
Insightshttps://github.com/logtail/logtail-python/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Flogtail%2Flogtail-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Flogtail%2Flogtail-python%2Fissues%2Fnew%2Fchoose
PetrHeinzhttps://github.com/PetrHeinz
masterhttps://github.com/logtail/logtail-python/tree/master
claude/t-17170-rq-fork-flushhttps://github.com/logtail/logtail-python/tree/claude/t-17170-rq-fork-flush
Conversation 0 https://github.com/logtail/logtail-python/pull/47
Commits 4 https://github.com/logtail/logtail-python/pull/47/commits
Checks 13 https://github.com/logtail/logtail-python/pull/47/checks
Files changed https://github.com/logtail/logtail-python/pull/47/files
Please reload this pagehttps://github.com/logtail/logtail-python/pull/47/files
T-17170 Flush after each RQ job and start forked children with a clean handler https://github.com/logtail/logtail-python/pull/47/files#top
Show all changes 4 commits https://github.com/logtail/logtail-python/pull/47/files
0c35147 T-17170 Add failing tests for RQ work horses losing their records and… PetrHeinz Sep 23, 2026 https://github.com/logtail/logtail-python/pull/47/commits/0c351474d644f254f4fa357b0e41fa87112b4916
39daa5b T-17170 Start forked children with a fresh queue, flush thread and HT… PetrHeinz Sep 23, 2026 https://github.com/logtail/logtail-python/pull/47/commits/39daa5b68977846c6968e0e699280c6c1e7edcb9
eaa750c T-17170 Add logtail.rq.Worker, which flushes buffered records after e… PetrHeinz Sep 23, 2026 https://github.com/logtail/logtail-python/pull/47/commits/eaa750ca702487ef5c3befb9e46ed98d185ade00
3422e0c Merge remote-tracking branch 'origin/master' into claude/t-17170-rq-f… PetrHeinz Sep 24, 2026 https://github.com/logtail/logtail-python/pull/47/commits/3422e0c0bdb5a5fb97b4024f55b17c7316a1dc6c
Clear filters https://github.com/logtail/logtail-python/pull/47/files
Please reload this pagehttps://github.com/logtail/logtail-python/pull/47/files
Please reload this pagehttps://github.com/logtail/logtail-python/pull/47/files
handler.py https://github.com/logtail/logtail-python/pull/47/files#diff-a9b0950e5b1ec28ff945c773b108d8b4b6617bfdbee33319a137ec929317e2cd
rq.py https://github.com/logtail/logtail-python/pull/47/files#diff-6853e85077bcb937df2cb2ffcdbc02189f3b8927fe7bc356eefdcc78c94f3f27
test-requirements.txt https://github.com/logtail/logtail-python/pull/47/files#diff-fac4c6890301d4de5c3f4266837803d5240c84a3d8b6c735bbc6a64c39d2f94e
test_handler.py https://github.com/logtail/logtail-python/pull/47/files#diff-3f86b181ab338949acfc1d27ff975b666acd3f0b016eb4bcce7c79fab09e463b
test_rq.py https://github.com/logtail/logtail-python/pull/47/files#diff-2355a76798c4c1e94148209e897877a04cd156e68952e25d501603727e043336
logtail/handler.pyhttps://github.com/logtail/logtail-python/pull/47/files#diff-a9b0950e5b1ec28ff945c773b108d8b4b6617bfdbee33319a137ec929317e2cd
View file https://github.com/logtail/logtail-python/blob/3422e0c0bdb5a5fb97b4024f55b17c7316a1dc6c/logtail/handler.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/47/{{ revealButtonHref }}
https://github.com/logtail/logtail-python/pull/47/files#diff-a9b0950e5b1ec28ff945c773b108d8b4b6617bfdbee33319a137ec929317e2cd
https://github.com/logtail/logtail-python/pull/47/files#diff-a9b0950e5b1ec28ff945c773b108d8b4b6617bfdbee33319a137ec929317e2cd
https://github.com/logtail/logtail-python/pull/47/files#diff-a9b0950e5b1ec28ff945c773b108d8b4b6617bfdbee33319a137ec929317e2cd
https://github.com/logtail/logtail-python/pull/47/files#diff-a9b0950e5b1ec28ff945c773b108d8b4b6617bfdbee33319a137ec929317e2cd
https://github.com/logtail/logtail-python/pull/47/files#diff-a9b0950e5b1ec28ff945c773b108d8b4b6617bfdbee33319a137ec929317e2cd
https://github.com/logtail/logtail-python/pull/47/files#diff-a9b0950e5b1ec28ff945c773b108d8b4b6617bfdbee33319a137ec929317e2cd
logtail/rq.pyhttps://github.com/logtail/logtail-python/pull/47/files#diff-6853e85077bcb937df2cb2ffcdbc02189f3b8927fe7bc356eefdcc78c94f3f27
View file https://github.com/logtail/logtail-python/blob/3422e0c0bdb5a5fb97b4024f55b17c7316a1dc6c/logtail/rq.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/47/{{ revealButtonHref }}
test-requirements.txthttps://github.com/logtail/logtail-python/pull/47/files#diff-fac4c6890301d4de5c3f4266837803d5240c84a3d8b6c735bbc6a64c39d2f94e
View file https://github.com/logtail/logtail-python/blob/3422e0c0bdb5a5fb97b4024f55b17c7316a1dc6c/test-requirements.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/47/{{ revealButtonHref }}
https://github.com/logtail/logtail-python/pull/47/files#diff-fac4c6890301d4de5c3f4266837803d5240c84a3d8b6c735bbc6a64c39d2f94e
tests/test_handler.pyhttps://github.com/logtail/logtail-python/pull/47/files#diff-3f86b181ab338949acfc1d27ff975b666acd3f0b016eb4bcce7c79fab09e463b
View file https://github.com/logtail/logtail-python/blob/3422e0c0bdb5a5fb97b4024f55b17c7316a1dc6c/tests/test_handler.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/47/{{ revealButtonHref }}
https://github.com/logtail/logtail-python/pull/47/files#diff-3f86b181ab338949acfc1d27ff975b666acd3f0b016eb4bcce7c79fab09e463b
https://github.com/logtail/logtail-python/pull/47/files#diff-3f86b181ab338949acfc1d27ff975b666acd3f0b016eb4bcce7c79fab09e463b
https://github.com/logtail/logtail-python/pull/47/files#diff-3f86b181ab338949acfc1d27ff975b666acd3f0b016eb4bcce7c79fab09e463b
tests/test_rq.pyhttps://github.com/logtail/logtail-python/pull/47/files#diff-2355a76798c4c1e94148209e897877a04cd156e68952e25d501603727e043336
View file https://github.com/logtail/logtail-python/blob/3422e0c0bdb5a5fb97b4024f55b17c7316a1dc6c/tests/test_rq.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/47/{{ revealButtonHref }}
Please reload this pagehttps://github.com/logtail/logtail-python/pull/47/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.