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

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

Merged
merged 2 commits into from Aug 31, 2018

Conversation

Projects
None yet
7 participants
@practicalswift
Copy link
Member

practicalswift commented May 3, 2018

Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP).

Context: #13148 (comment)

Thanks @ajtowns!

@practicalswift practicalswift changed the title Don't close old debug log file handler prematurely when trying to re-open (on SIGHUP) Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) May 3, 2018

@practicalswift practicalswift force-pushed the practicalswift:handle-reopen-failed branch 2 times, most recently May 3, 2018

@luke-jr
Copy link
Member

luke-jr left a comment

utACK

luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Jul 7, 2018

Don't close old debug log file handle prematurely when trying to re-o…
…pen (on SIGHUP)

Github-Pull: bitcoin#13159
Rebased-From: c4671629c5ee430238222d43f140ca8565c028b1
@DrahtBot

This comment has been minimized.

Copy link
Contributor

DrahtBot commented Jul 22, 2018

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.
@ajtowns

This comment has been minimized.

Copy link
Contributor

ajtowns commented Aug 7, 2018

Tested ACK 37efe5b7ea059e56d8f5170c91e3160db286cad4

To test:

$ bitcoind -regtest -daemon
$ cd ~/.bitcoin/regtest
$ mv debug.log{,.old}
$ touch debug.log; chmod 400 debug.log
$ killall -HUP bitcoind
$ bitcoin-cli -regtest savemempool

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.

@MarcoFalke

This comment has been minimized.

Copy link
Member

MarcoFalke commented Aug 20, 2018

utACK 37efe5b7ea059e56d8f5170c91e3160db286cad4

@practicalswift practicalswift force-pushed the practicalswift:handle-reopen-failed branch to 75ea00f Aug 29, 2018

@practicalswift

This comment has been minimized.

Copy link
Member Author

practicalswift commented Aug 29, 2018

Rebased!

@luke-jr @ajtowns @MarcoFalke Please re-review :-)

@DrahtBot DrahtBot removed the Needs rebase label Aug 29, 2018

@MarcoFalke

This comment has been minimized.

Copy link
Member

MarcoFalke commented Aug 29, 2018

re-utACK 75ea00f

@ajtowns

This comment has been minimized.

Copy link
Contributor

ajtowns commented Aug 30, 2018

re-ACK 75ea00f

@laanwj

This comment has been minimized.

Copy link
Member

laanwj commented Aug 31, 2018

utACK 75ea00f, good to get rid of the need of freopen I suppose

@laanwj laanwj merged commit 75ea00f into bitcoin:master Aug 31, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Aug 31, 2018

Merge #13159: Don't close old debug log file handle prematurely 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: #13148 (comment)

  Thanks @ajtowns!

Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.