Page MenuHomePhabricator

Merge #13159: Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP)
ClosedPublic

Authored by nakihito on Fri, Aug 30, 20:53.

Details

Reviewers
deadalnix
Fabien
jasonbcox
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC3bdbe4821611: Merge #13159: Don't close old debug log file handle prematurely when trying to…
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: https://github.com/bitcoin/bitcoin/pull/13148#issuecomment-386288606

Thanks @ajtowns!

Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1

Backport of Core PR13159
https://github.com/bitcoin/bitcoin/pull/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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

nakihito created this revision.Fri, Aug 30, 20:53
Owners added a reviewer: Restricted Owners Package.Fri, Aug 30, 20:53
Herald added a reviewer: Restricted Project. · View Herald TranscriptFri, Aug 30, 20:53
Fabien accepted this revision.Tue, Sep 3, 07:58
This revision is now accepted and ready to land.Tue, Sep 3, 07:58