-
Notifications
You must be signed in to change notification settings - Fork 41
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
Bug/skaled 1623 sigterm at exit #1695
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a7cf816
SKALED-1623 Don't force exit on signal after internal exit
dimalit b66cb8f
Merge branch 'develop' into bug/SKALED-1623-sigterm-at-exit
dimalit a9a5d09
Merge remote-tracking branch 'origin/develop' into bug/SKALED-1623-si…
dimalit 9692d78
SKALED-1623 Logs fix
dimalit 10fc6ea
Merge remote-tracking branch 'origin/v3.18.0' into bug/SKALED-1623-si…
dimalit 07d98ad
Merge branch 'v3.18.0' into bug/SKALED-1623-sigterm-at-exit
dimalit e7c9f4f
Merge branch 'v3.18.0' into bug/SKALED-1623-sigterm-at-exit
dimalit e47968b
SKALED-1623 Remove coloring
dimalit 0c2e1e7
Merge branch 'v3.18.0' into bug/SKALED-1623-sigterm-at-exit
dimalit 22eed15
SKALED-1623 Use new branch in skale-ci
dimalit 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,11 +47,18 @@ | |
} | ||
|
||
void ExitHandler::exitHandler( int nSignalNo, ExitHandler::exit_code_t ec ) { | ||
std::string strMessagePrefix = ExitHandler::shouldExit() ? | ||
cc::error( "\nStop flag was already raised on. " ) + | ||
cc::fatal( "WILL FORCE TERMINATE." ) + | ||
cc::error( " Caught (second) signal. " ) : | ||
cc::error( "\nCaught (first) signal. " ); | ||
std::string strMessagePrefix; | ||
if ( nSignalNo > 0 ) { | ||
strMessagePrefix = ( ExitHandler::shouldExit() && s_nStopSignal > 0 ) ? | ||
cc::error( "\nStop flag was already raised on. " ) + | ||
cc::fatal( "WILL FORCE TERMINATE." ) + | ||
cc::error( " Caught (second) signal. " ) : | ||
cc::error( "\nCaught (first) signal. " ); | ||
} else { | ||
strMessagePrefix = ExitHandler::shouldExit() ? | ||
cc::error( "\nInternal exit requested while already exiting. " ) : | ||
cc::error( "\nInternal exit initiated. " ); | ||
} | ||
std::cerr << strMessagePrefix << cc::error( skutils::signal::signal2str( nSignalNo ) ) | ||
<< "\n\n"; | ||
std::cerr.flush(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this line since cerr is always flushed on line end |
||
|
@@ -153,7 +160,8 @@ | |
|
||
// nice exit here: | ||
|
||
if ( ExitHandler::shouldExit() ) { | ||
// TODO deduplicate with first if() | ||
if ( ExitHandler::shouldExit() && s_nStopSignal > 0 && nSignalNo > 0 ) { | ||
std::cerr << ( "\n" + cc::fatal( "SIGNAL-HANDLER:" ) + " " + | ||
cc::error( "Will force exit now..." ) + "\n\n" ); | ||
_exit( 13 ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is 13 used here ? Is there a document in which error codes are defined? |
||
|
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.
Please remove color comments