Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use channel semantics to manage LogStream lifecycle in Tailer. #893

Merged
merged 11 commits into from
Jul 5, 2024

Conversation

jaqx0r
Copy link
Contributor

@jaqx0r jaqx0r commented Jul 5, 2024

Removes most of the LogStream interface functions, moving some functionality into the LogStream and using only closure of the lines channel to signal stream shutdown. All external notices are now handled by Context cancellation.

The stale_log_gc_interval flag is now deprecated as these are cleaned up at stream shutdown.

Issue: #199

jaqx0r added 10 commits July 5, 2024 08:09
After each read we reset a timer using `AfterFunc` to cancel the context if the
timer expires.

This removes the use of the `Stop` call from the Tailer.
We exit with context cancellation now, so don't need a second way to initiate
stream shutdown.
This duplicates work with the gc poll but acts immediately when the stream
ends.

The glob test is updated because now the streams are guaranteed to exit during
shutdown and `stopM` was being called too early.
Cleanup happens in the tailer when the stream channel closes, so we can remove
the GC function to do cleanup.

Removing the method means we need a new way to check for completion in test,
which we can do by looking at the value coming off the channel.
This is no longer needed as is handled immediately by the tailer when the
stream channel closes.

The command line flag is now deprecated.
@jaqx0r jaqx0r enabled auto-merge July 5, 2024 06:13
@jaqx0r jaqx0r added this pull request to the merge queue Jul 5, 2024
Copy link
Contributor

github-actions bot commented Jul 5, 2024

Unit Test Results

    1 files     27 suites   8m 40s ⏱️
  648 tests   647 ✅ 1 💤 0 ❌
1 917 runs  1 914 ✅ 3 💤 0 ❌

Results for commit f39cf7b.

Merged via the queue into main with commit b8df61a Jul 5, 2024
23 checks passed
@jaqx0r jaqx0r deleted the logstream-shutdown branch July 5, 2024 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant