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

improve shutdown of host interaction recorders #913

Merged
merged 1 commit into from Feb 5, 2024

Conversation

peterjan
Copy link
Member

This PR slightly improves how we handle host interactions on worker shutdown by swapping out the flush context with the context we pass to the worker on shutdown, essentially allowing interactions to be flushed for as long as we allow the worker to shut down gracefully. On shutdown we also set the interval to 0 essentially immediately flushing the interactions to the bus. Both these changes ensure that all interactions that occur during a worker shutdown have every chance of making it into the database.

@peterjan peterjan self-assigned this Jan 22, 2024
@peterjan peterjan marked this pull request as ready for review January 22, 2024 10:04
worker/download.go Show resolved Hide resolved
worker/interactions.go Outdated Show resolved Hide resolved
worker/interactions.go Show resolved Hide resolved
@peterjan
Copy link
Member Author

I resolved all comments. I do see the (edge-case) race but as this is an improvement over what we have and since we have to revisit recorders after RHPv4 I propose we merge and revisit it later. Graceful shutdowns do feel nice and with current implementation we do record all host interactions, in the event of an edge case we only log an error for an interaction we later successfully record in the bus. Providing the uploads/downloads finish in due time.

@ChrisSchinnerl ChrisSchinnerl merged commit 8e9a748 into dev Feb 5, 2024
6 checks passed
@ChrisSchinnerl ChrisSchinnerl deleted the pj/improve-recorder-shutdown branch February 5, 2024 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

None yet

2 participants