René's URL Explorer Experiment


Title: Fix flush thread crashing (AttributeError) on a real server HTTP 500 by jaideeppyne · Pull Request #41 · logtail/logtail-python · GitHub

Open Graph Title: Fix flush thread crashing (AttributeError) on a real server HTTP 500 by jaideeppyne · Pull Request #41 · logtail/logtail-python

X Title: Fix flush thread crashing (AttributeError) on a real server HTTP 500 by jaideeppyne · Pull Request #41 · logtail/logtail-python

Description: Summary Fixes #25. FlushWorker.step decides whether to log an upload failure with: if response.status_code == 500 and getattr(response, "exception") != None: getattr(response, "exception") is called without a default. The two things step can receive are asymmetric: On a network error, Uploader.__call__ catches requests.RequestException and returns Fake500(e) — which has an .exception attribute. On a genuine server HTTP 500, session.post(...) returns a real requests.Response — which has no .exception attribute. So on a real 500, status_code == 500 is True, then getattr(response, "exception") raises AttributeError. That propagates out of step() → run(), so the background flush thread dies. Every subsequent log is enqueued but never sent for the rest of the process — silent log loss. This matches the reporter's "happens occasionally" (real 500s are intermittent). Fix - if response.status_code == 500 and getattr(response, "exception") != None: + if response.status_code == 500 and getattr(response, "exception", None) is not None: A real Response now yields None and skips the branch; the network-error Fake500 path still logs its exception as before. (Also switched != None → is not None to match idiom.) Tests Two regression tests in tests/test_flusher.py: test_step_does_not_crash_on_real_server_500 — returns a real requests.Response with status_code = 500; step() must not raise. This fails on the current code with the exact AttributeError: 'Response' object has no attribute 'exception' from #25. test_step_still_logs_network_error_fake500 — the Fake500 network-error path still logs. ⚠️ Worth noting: the existing tests use mock.MagicMock(status_code=500), and MagicMock auto-vivifies .exception, which is why they never caught this — the new test deliberately uses a real Response. Full tests/test_flusher.py suite passes (11 tests).

Open Graph Description: Summary Fixes #25. FlushWorker.step decides whether to log an upload failure with: if response.status_code == 500 and getattr(response, "exception") != None: getattr(response, "excep...

X Description: Summary Fixes #25. FlushWorker.step decides whether to log an upload failure with: if response.status_code == 500 and getattr(response, "exception") != None: getattr(response, &am...

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

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:14d9e821-e9c5-a002-b98e-efc96f8d1ff3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAB18:7F3F9:23E612:312F37:6AFBB020
html-safe-nonce000873a7a24a0093cfb5b39ef4a45429f31f02e8e5893c3790355276470d35fd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjE4OjdGM0Y5OjIzRTYxMjozMTJGMzc6NkFGQkIwMjAiLCJ2aXNpdG9yX2lkIjoiMjM3OTY3ODMwNDg5NTIxNzY5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacca398c52b3a0deabc7d3973dd4bcab7ead90c4d597b348c073936dde385dc8f6
hovercard-subject-tagpull_request:4301854478
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/41/files
twitter:imagehttps://avatars.githubusercontent.com/u/25899506?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/25899506?s=400&v=4
og:image:altSummary Fixes #25. FlushWorker.step decides whether to log an upload failure with: if response.status_code == 500 and getattr(response, "exception") != None: getattr(response, "excep...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonee25fbd830d3e6ad0e8935c105cf4fdc70c593dffcd27bb45b790ae4fece5ea55
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
release08c8f17f9d27054a108b8b6254e405de0151f660
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/logtail/logtail-python/pull/41/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flogtail%2Flogtail-python%2Fpull%2F41%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%2F41%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/41/files
Reloadhttps://github.com/logtail/logtail-python/pull/41/files
Reloadhttps://github.com/logtail/logtail-python/pull/41/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
logtail:masterhttps://github.com/logtail/logtail-python/tree/master
jaideeppyne:fix/flusher-attributeerror-real-500https://github.com/jaideeppyne/logtail-python/tree/fix/flusher-attributeerror-real-500
Conversation 1 https://github.com/logtail/logtail-python/pull/41
Commits 2 https://github.com/logtail/logtail-python/pull/41/commits
Checks 7 https://github.com/logtail/logtail-python/pull/41/checks
Files changed https://github.com/logtail/logtail-python/pull/41/files
Please reload this pagehttps://github.com/logtail/logtail-python/pull/41/files
Fix flush thread crashing (AttributeError) on a real server HTTP 500 https://github.com/logtail/logtail-python/pull/41/files#top
Show all changes 2 commits https://github.com/logtail/logtail-python/pull/41/files
60ca325 Fix flush thread crashing on a real server HTTP 500 (#25) jaideeppyne Aug 18, 2026 https://github.com/logtail/logtail-python/pull/41/commits/60ca325813bb1c5d89e669f2eb4b8e2b4476139c
99e953f Merge branch 'master' into fix/flusher-attributeerror-real-500 PetrHeinz Sep 24, 2026 https://github.com/logtail/logtail-python/pull/41/commits/99e953ff386f1345c22a2a6fb7d8b3d9c7a9e83b
Clear filters https://github.com/logtail/logtail-python/pull/41/files
Please reload this pagehttps://github.com/logtail/logtail-python/pull/41/files
Please reload this pagehttps://github.com/logtail/logtail-python/pull/41/files
flusher.py https://github.com/logtail/logtail-python/pull/41/files#diff-8a07bff24d8cc7c814a976f4c2db795ba1fff25f57eb18f3dd5203c2e77ef533
test_flusher.py https://github.com/logtail/logtail-python/pull/41/files#diff-f17c869b31f30e711632530bb52ff81b91a288179d365ff7776c8a7cb24c6db9
logtail/flusher.pyhttps://github.com/logtail/logtail-python/pull/41/files#diff-8a07bff24d8cc7c814a976f4c2db795ba1fff25f57eb18f3dd5203c2e77ef533
View file https://github.com/jaideeppyne/logtail-python/blob/99e953ff386f1345c22a2a6fb7d8b3d9c7a9e83b/logtail/flusher.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/41/{{ revealButtonHref }}
https://github.com/logtail/logtail-python/pull/41/files#diff-8a07bff24d8cc7c814a976f4c2db795ba1fff25f57eb18f3dd5203c2e77ef533
https://github.com/logtail/logtail-python/pull/41/files#diff-8a07bff24d8cc7c814a976f4c2db795ba1fff25f57eb18f3dd5203c2e77ef533
tests/test_flusher.pyhttps://github.com/logtail/logtail-python/pull/41/files#diff-f17c869b31f30e711632530bb52ff81b91a288179d365ff7776c8a7cb24c6db9
View file https://github.com/jaideeppyne/logtail-python/blob/99e953ff386f1345c22a2a6fb7d8b3d9c7a9e83b/tests/test_flusher.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/41/{{ revealButtonHref }}
https://github.com/logtail/logtail-python/pull/41/files#diff-f17c869b31f30e711632530bb52ff81b91a288179d365ff7776c8a7cb24c6db9
https://github.com/logtail/logtail-python/pull/41/files#diff-f17c869b31f30e711632530bb52ff81b91a288179d365ff7776c8a7cb24c6db9
https://github.com/logtail/logtail-python/pull/41/files#diff-f17c869b31f30e711632530bb52ff81b91a288179d365ff7776c8a7cb24c6db9
Please reload this pagehttps://github.com/logtail/logtail-python/pull/41/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.