forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Return non-zero exit code for non graceful shutdown #8
Merged
alexander-jiang
merged 12 commits into
data_infra_vector_stable
from
panic-for-non-graceful-shutdown
Jan 14, 2025
+16
−8
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bd7b96d
Panic if the components failed to gracefully shutdown in time
alexander-jiang 62e70a4
try to fix the compile error
alexander-jiang c445adb
fix more compile errors/warnings - remove unreachable code, specify g…
alexander-jiang 3d28e26
try to fix compile error again
alexander-jiang 4e290f9
map the infinite-loop future to return a Result instead
alexander-jiang 2fe231a
clean up the panic msg and variable names
alexander-jiang ebafc38
add list of components that failed to shut down in time to panic msg
alexander-jiang 00de9d8
fix the panic format string syntax
alexander-jiang 67fb2dc
fix a compile error
alexander-jiang 290f56e
add some debug logs to check my hypothesis: when the buffer reader is…
alexander-jiang e37a2f3
tweak debug log msgs
alexander-jiang b05ef55
fix missing semicolon
alexander-jiang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to avoid a
panic!
here without changing the interface. Given this seems to be returning aFuture
, can we wrap aResult
in a future instead and unwrap that in the exit handlers?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I guess the output future is bounded to contain a unit type here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexander-jiang what do u think of
panic!
ing after you collect all the values instead of as soon as you see the first error? this will let all the components shutdown before we engage the panic trap to crash out when we detect a bad shutdown.also we should tag this to the team for review more widely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is the
future::join
will wait for both the futures (source_shutdown_complete
andshutdown_complete_future
) to complete before returning, so we only panic after waiting for both of those futures to complete.The
shutdown_complete_future
uses afuture::select_all
over the futures, which waits until any of specified futures are ready, however, in that case I think it is correct to not wait for all - theselect_all
will wait until the deadline is exceeded (thetimeout
future) or until all the tasks are done (thesuccess
future), thereporter
future is an infinite loop that writes a log message/event.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small correction i think - the
select_all
handler in https://github.com/discord/vector/pull/8/files#diff-bdafd184965fb9c8ceeb9213965a2d5dbe43037d8f5f3501f3d0fb9d11b4cc8fR197 waits till the first event between -timeout
,success
or thereporting(currently running)
components returns.which makes me think we should also declare the timeout scenario likely to also be erroneous even if any component was not having a reporting loop for completion? 💭 though this scenario is likely not to manifest from my interpretation