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

DB connection in register phase breaks pre-5.4.1 behavior #174

Open
yaauie opened this issue Sep 17, 2024 · 0 comments
Open

DB connection in register phase breaks pre-5.4.1 behavior #174

yaauie opened this issue Sep 17, 2024 · 0 comments
Labels
bug Something isn't working status:confirmed

Comments

@yaauie
Copy link
Contributor

yaauie commented Sep 17, 2024

In v5.4.1, establishing the database connection pool was moved from the run-phase (where problems are retried) to the register-phase (which can cause a pipeline to fail to start).

This was done as a part of mitigating a connection leak caused by a new connection pool being instantiated for each invocation of the scheduler (an anti-pattern of the Sequel library we use).

The effect of moving from run-phase to register-phase is that if an instance cannot connect while a pipeline is starting, manual intervention is required to get the pipeline running again (e.g., restarting the Logstash process or modifying the pipeline definition so that auto-reload will kick in); the pipeline cannot self-recover from a transient error if that error occurs during pipeline startup.


I believe we should restore the prior behavior of establishing the connection pool in the run-phase, and to continue to avoid closing the connection pool until the plugin is closed (at shutdown). This would allow us to pull-forward the prior behavior of retrying initial-connection failures while avoiding re-creating the connection leak.

@yaauie yaauie added bug Something isn't working status:confirmed labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:confirmed
Projects
None yet
Development

No branches or pull requests

1 participant