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

Add test for elasticsearch re-connection after network error & allow graceful shutdown #40794

Merged
merged 26 commits into from
Oct 25, 2024

Commits on Oct 22, 2024

  1. Fix elasticsearch re-connection after network error

    When the Elasticsearch client fails to publish events, it ends up
    calling `Close` in the connection (that is reused). To cancel the
    in-flight requests, the context is cancelled and a new one is created
    to used in future requests.
    
    The callback to check the version holds a reference to the connection
    via a closure, now the Elasticsearch client holds a pointer to that
    connection, so whenever Close is called, the callback can create a
    request with the new, not cancelled, context.
    
    An integration test is added to ensure the
    ES output can always recover from network errors.
    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    c5bb19c View commit details
    Browse the repository at this point in the history
  2. Move creating the request context to Connect

    This commit moves the creation of the request context to the connect
    method.
    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    1e02543 View commit details
    Browse the repository at this point in the history
  3. Fix tests and lint warnings

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    59541dc View commit details
    Browse the repository at this point in the history
  4. Initialise reqsContext in NewConnections

    There are some cases where the Connection will be used without calling
    Connect, so we initialise reqsContext and cancelReqs in the
    NewConnection function to avoid panics.
    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    76d986b View commit details
    Browse the repository at this point in the history
  5. Fix lint warnings

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    fe2140a View commit details
    Browse the repository at this point in the history
  6. Fix lint warnings

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    f8411f9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fcab79c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4b41bb6 View commit details
    Browse the repository at this point in the history
  9. Improve comments

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    d76c0d2 View commit details
    Browse the repository at this point in the history
  10. Accept a context on Connect

    Connection.Connect now accepts a context to control the life cycle of
    its requests.
    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    6cef800 View commit details
    Browse the repository at this point in the history
  11. Fix python dependencies

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    2e74ea4 View commit details
    Browse the repository at this point in the history
  12. Add context to outputs.Connectable interface

    Add a context to outputs.Connectable.Connect to correctly manage the
    life cycle of the connection and it's requests.
    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    198b01b View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    fc20198 View commit details
    Browse the repository at this point in the history
  14. update tests

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    3ca5b9c View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    5b962d2 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    459b869 View commit details
    Browse the repository at this point in the history
  17. Fix lint warnings

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    eee35b7 View commit details
    Browse the repository at this point in the history
  18. Fix tests

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    ab39277 View commit details
    Browse the repository at this point in the history
  19. Fix tests

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    5f6edcc View commit details
    Browse the repository at this point in the history
  20. Fix tests

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    09c7581 View commit details
    Browse the repository at this point in the history
  21. Fix more tests

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    8a56f6e View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    5f04323 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    f03154b View commit details
    Browse the repository at this point in the history
  24. Address PR comments

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    f3502a3 View commit details
    Browse the repository at this point in the history
  25. PR improvements

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    5e09644 View commit details
    Browse the repository at this point in the history
  26. fix merge conflicts

    belimawr committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    f79c8a6 View commit details
    Browse the repository at this point in the history