-
Notifications
You must be signed in to change notification settings - Fork 378
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
Conversation
This file contains 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
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 is no longer used in the Tailer.
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
force-pushed
the
logstream-shutdown
branch
from
July 5, 2024 06:17
2681366
to
f39cf7b
Compare
Unit Test Results 1 files 27 suites 8m 40s ⏱️ Results for commit f39cf7b. |
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.
Removes most of the
LogStream
interface functions, moving some functionality into theLogStream
and using only closure of the lines channel to signal stream shutdown. All external notices are now handled byContext
cancellation.The
stale_log_gc_interval
flag is now deprecated as these are cleaned up at stream shutdown.Issue: #199