fix: Correct data source error reporting#447
Merged
Merged
Conversation
Two pre-existing bugs in the sync data-source error reporting, independent of the async work: - datasource/polling.py: pass time.time() (not the uncalled time.time) so the UNKNOWN-error DataSourceErrorInfo records a real timestamp. - datasourcev2/polling.py: use response.status in the HTTP-error message instead of interpolating the urllib3 response object. Also retargets the stale version-gated-upsert TODO in datasource/status.py to SDK-62 (the proper fix needs a breaking upsert -> bool change, deferred to the next major version). SDK-2592
cd755e8 to
a10aeee
Compare
keelerm84
approved these changes
Jun 24, 2026
…ion close eventsource 1.7.1 corrects pool ownership so a caller-supplied pool is left intact on close, letting the SDK close streaming connections synchronously (TCP FIN sent immediately) instead of deferring to garbage collection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A bug fix and a small cleanup in the synchronous data-source error path, found while building the async SDK (SDK-60) and extracted as an independent PR ahead of the async slices. Neither depends on async; this is the first PR of that stacked sequence.
datasource/polling.py(bug fix) — the UNKNOWN-error branch passed the uncalledtime.timefunction (instead oftime.time()) as the timestamp, so every unexpected polling error recorded a bogus non-numericDataSourceErrorInfo.time.datasourcev2/polling.py(cleanup, no behavior change) — useresponse.statusin the HTTP-error message instead of interpolating the wholeurllib3response object. This string is currently unread on the HTTP-error path (consumers rebuild the message from the status code), so it's fixed for forward-cleanliness.Testing
Full unit suite green (1012 passed, 0 failed); mypy + isort + pycodestyle clean.
SDK-2592
Note
Low Risk
Small error-reporting and dependency bumps with no auth, store, or evaluation logic changes.
Overview
Fixes incorrect timestamps on unexpected polling failures in the legacy
PollingUpdateProcessor: the UNKNOWN-error path now passestime.time()instead of thetime.timefunction reference, soDataSourceErrorInfo.timeis a real epoch value for status listeners and diagnostics.In datasource v2 polling, HTTP failure
_Failmessages now useresponse.statusinstead of stringifying the whole urllib3 response (cosmetic; consumers still derive messages from the status code).Also bumps
launchdarkly-eventsourceto>=1.7.1,<2.0.0and refreshes a TODO comment inDataSourceUpdateSinkImpl.upsert(SDK-62); no behavior change there.Reviewed by Cursor Bugbot for commit c67844e. Bugbot is set up for automated code reviews on this repo. Configure here.