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

Commits on Jul 5, 2024

  1. refactor: LogStreams manage their own staleness expiration.

    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.
    jaqx0r committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    84c53b5 View commit details
    Browse the repository at this point in the history
  2. refactor: Remove Stop from the LogStream interface.

    We exit with context cancellation now, so don't need a second way to initiate
    stream shutdown.
    jaqx0r committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    d4b0a50 View commit details
    Browse the repository at this point in the history
  3. refactor: Remove LastReadTime from the LogStream interface.

    This is no longer used in the Tailer.
    jaqx0r committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    1830e87 View commit details
    Browse the repository at this point in the history
  4. feat: Remove LogStreams when the lines channels are closed.

    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.
    jaqx0r committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    7aebf03 View commit details
    Browse the repository at this point in the history
  5. refactor: Remove IsComplete from the LogStream interface.

    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.
    jaqx0r committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    f2d8c1c View commit details
    Browse the repository at this point in the history
  6. refactor: Remove the gcWaker from the Tailer.

    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 committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    9552a9b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4a3aed5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d3c493e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    bfe5fec View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    cf3931d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f39cf7b View commit details
    Browse the repository at this point in the history