Repository navigation
fix: redirect the run log when the first log stream comes back empty - #1084
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1084 +/- ##
==========================================
+ Coverage 95.41% 95.53% +0.11%
==========================================
Files 61 61
Lines 5894 5935 +41
==========================================
+ Hits 5624 5670 +46
+ Misses 270 265 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
marked this pull request as ready for review
October 2, 2026 10:01
Mantisus
reviewed
Oct 7, 2026
Pijukatel
approved these changes
Oct 9, 2026
vdusek
added a commit
to apify/apify-client-js
that referenced
this pull request
Oct 9, 2026
…1105) `call({ log })` and `run.getStreamedLog()` sometimes redirected no log lines, which made the `call({ log: "default" })` integration test flaky. Before a run writes its first line, the API answers `GET /logs/:id?stream=1` with an empty 200 that closes at once (about 1 in 20 fresh `apify/hello-world` runs), and `StreamedLog` took that as the whole log. `StreamedLog` now reopens an empty stream after a pause that starts at 500 ms and doubles up to 5 s. If `stop()` comes before anything has arrived, it reads the log once with `get()`. This also covers a stream still connecting when the `stop()` grace period ends. Tests cover the same cases as apify/apify-client-python#1084, plus the backoff and the grace-period fallback. *✍️ Drafted by Claude Code*
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.
Python twin of apify/apify-client-js#1105.
call(logger=...)andget_streamed_log()sometimes redirected no log lines. Before a run writes its first line, the API answersGET /logs/:id?stream=1with an empty 200 that closes at once, andStreamedLog/StreamedLogAsynctook that as the whole log.Both now reopen an empty stream after a pause that starts at 0.5 s and doubles up to 5 s. If
stop()comes before anything has arrived, they read the log once withget_as_bytes().start()resets that state, so a restarted instance behaves the same.Tests cover the same cases as #1105 for both classes and both HTTP clients, plus the backoff and a restart.
✍️ Drafted by Claude Code