-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) #13159
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
Conversation
2f64058
to
37efe5b
Compare
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.
utACK
…pen (on SIGHUP) Github-Pull: bitcoin#13159 Rebased-From: c4671629c5ee430238222d43f140ca8565c028b1
The last travis run for this pull request was 80 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened. |
Tested ACK 37efe5b7ea059e56d8f5170c91e3160db286cad4 To test:
Current behaviour of master is that the "Dumped mempool" message (along with any other subsequent log messages) aren't logged to a file, and further that fixing permissions on debug.log and HUP'ing the process isn't sufficient to re-enable logging to file. With the patch, logging continues in debug.log.old, and after fixing the permissions HUP'ing the process causes logging to move to the new file. |
utACK 37efe5b7ea059e56d8f5170c91e3160db286cad4 |
37efe5b
to
75ea00f
Compare
Rebased! @luke-jr @ajtowns @MarcoFalke Please re-review :-) |
re-utACK 75ea00f |
re-ACK 75ea00f |
utACK 75ea00f, good to get rid of the need of |
…trying to re-open (on SIGHUP) 75ea00f Remove unused fsbridge::freopen (practicalswift) cceedbc Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift) Pull request description: Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`). Context: #13148 (comment) Thanks @ajtowns! Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1
…trying to re-open (on SIGHUP) Summary: 75ea00f391b742e435c650aae3e827aad913d552 Remove unused fsbridge::freopen (practicalswift) cceedbc4bf1056db17e0adf76d0db45b94777671 Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift) Pull request description: Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`). Context: bitcoin/bitcoin#13148 (comment) Thanks @ajtowns! Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1 Backport of Core PR13159 bitcoin/bitcoin#13159 Depends on D3976 Test Plan: make check ./bitcoind -regtest -daemon cd <path>/.bitcoin/regtest mv debug.log{,.old} touch debug.log; chmod 400 debug.log killall -HUP bitcoind <patch>/bitcoin-abc/build/src/bitcoin-cli -regtest savemempool Verify that the new debug.log file is empty and debug.log.old continued to be written to Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3979
…trying to re-open (on SIGHUP) Summary: 75ea00f391b742e435c650aae3e827aad913d552 Remove unused fsbridge::freopen (practicalswift) cceedbc4bf1056db17e0adf76d0db45b94777671 Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift) Pull request description: Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`). Context: bitcoin/bitcoin#13148 (comment) Thanks @ajtowns! Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1 Backport of Core PR13159 bitcoin/bitcoin#13159 Depends on D3976 Test Plan: make check ./bitcoind -regtest -daemon cd <path>/.bitcoin/regtest mv debug.log{,.old} touch debug.log; chmod 400 debug.log killall -HUP bitcoind <patch>/bitcoin-abc/build/src/bitcoin-cli -regtest savemempool Verify that the new debug.log file is empty and debug.log.old continued to be written to Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3979
…trying to re-open (on SIGHUP) Summary: 75ea00f391b742e435c650aae3e827aad913d552 Remove unused fsbridge::freopen (practicalswift) cceedbc4bf1056db17e0adf76d0db45b94777671 Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift) Pull request description: Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`). Context: bitcoin/bitcoin#13148 (comment) Thanks @ajtowns! Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1 Backport of Core PR13159 bitcoin/bitcoin#13159 Depends on D3976 Test Plan: make check ./bitcoind -regtest -daemon cd <path>/.bitcoin/regtest mv debug.log{,.old} touch debug.log; chmod 400 debug.log killall -HUP bitcoind <patch>/bitcoin-abc/build/src/bitcoin-cli -regtest savemempool Verify that the new debug.log file is empty and debug.log.old continued to be written to Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3979
84b4185 [Tests] raise minimum fee in feature_blockindexstats (random-zebra) 39d8a20 [Cleanup] Remove OldSetKeyFromPassphrase/OldEncrypt/OldDecrypt (random-zebra) 613e1da [BUG] Fix sizeof in paymentservertests (random-zebra) 0f3e961 [Cleanup] Remove useless call (random-zebra) b1ca5e0 Remove unused fsbridge::freopen (practicalswift) b3a1d84 Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift) ecfbcfd [Cleanup] Remove unused function AddInvalidSpendsToMap (random-zebra) 15b018c [Refactor] Use InsecureRand in the unit tests (random-zebra) 81fd84c [Refactoring] Replace risky call to rand() with GetRandInt() (random-zebra) 8ba1978 [Qt] Terminate string *pszExePath after readlink and without using memset (practicalswift) b6cd719 Remove unreachable code (g_rpcSignals.PostCommand) (practicalswift) e4f9ab3 [BUG] Memory leak after new CNode / ConnectNode (random-zebra) 536122b Avoid rollingMinimumFeeRate never being able to decay below half (Alex Morcos) 13cad19 fix a bug if the min fee is 0 for FeeFilterRounder (Alex Morcos) aa832d8 [Refactoring] Dereference before/after null check (random-zebra) 4630b7d [Trivial] Pass big parameters by reference, not value (random-zebra) aa7bc7f [Refactoring] Remove unneeded CScript::IsNormalPaymentScript (random-zebra) 6cf3c8f [Trivial] Unitialized scalar fields and variables (random-zebra) Pull request description: This is a collection of small fixes for the following issues/defects (discovered with the coverity tool): - Big parameters passed by value - calls to rand() function - Dereference before/after null-pointer check - Pointer to local variable out of scope - Resource leak with call to ConnectNode - Non-floating point result - unintended integer division (bitcoin#9288) - String not-null-terminated (bitcoin#11193) - Structurally dead code (bitcoin#9575) - Unchecked boolean return value of functions (GetOp, GetTransaction, TxOutToPublicCoin) - Unitialized pointers and scalar fields - Illegal memory access (bitcoin#13159) - Useless call to pubkey.IsCompressed() - Wrong `sizeof` argument (bitcoin#11024 + revert #494) ACKs for top commit: furszy: Looking good, ACK 84b4185 Fuzzbawls: ACK 84b4185 Tree-SHA512: 4c920a1858ccde65795c090e4becc47c50c0a78db7ab11935b4d3e2bea3f7f1f8ca3b48ce633d8112673092c35ae7cd05c444ed2b16e283a305c765874e55c1c
…y when trying to re-open (on SIGHUP) 75ea00f Remove unused fsbridge::freopen (practicalswift) cceedbc Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift) Pull request description: Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`). Context: bitcoin#13148 (comment) Thanks @ajtowns! Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1 # Conflicts: # src/logging.cpp
…y when trying to re-open (on SIGHUP) 75ea00f Remove unused fsbridge::freopen (practicalswift) cceedbc Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift) Pull request description: Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`). Context: bitcoin#13148 (comment) Thanks @ajtowns! Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1 # Conflicts: # src/logging.cpp
…y when trying to re-open (on SIGHUP) 75ea00f Remove unused fsbridge::freopen (practicalswift) cceedbc Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift) Pull request description: Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`). Context: bitcoin#13148 (comment) Thanks @ajtowns! Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1 # Conflicts: # src/logging.cpp
Don't close old debug log file handle prematurely when trying to re-open (on
SIGHUP
).Context: #13148 (comment)
Thanks @ajtowns!