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

hubble: Never fail with ErrInvalidRead #17046

Merged
merged 1 commit into from
Aug 18, 2021

Commits on Aug 4, 2021

  1. hubble: Never fail with ErrInvalidRead

    Currently GetFlows() fails with the following error when a position in
    the ring buffer being read by Ring.read() has been overwritten:
    
        requested data has been overwritten and is no longer available
    
    This turned out to be impractical as it makes it difficult to read all
    the flows in the ring buffer (e.g.. hubble observe --all). GetFlows()
    would fail if Hubble observes a single flow between the reader rewinding
    to the oldest position and retrieving the entry.
    
    This patch modifies Ring.read() so that GetFlows() returns LostEvent
    instead of stopping with an error. The caller of GetFlows() can then
    decide how to handle LostEvent.
    
    Note that this makes the behavior of Ring.read() consistent with that
    of Ring.readFrom() used in the follow mode. It generates LostEvent and
    continues following instead of failing with ErrInvalidRead.
    
    Fixes: cilium#17036
    
    Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
    michi-covalent committed Aug 4, 2021
    Configuration menu
    Copy the full SHA
    79be7fc View commit details
    Browse the repository at this point in the history