cmd/geth: Graceful shutdown if disk is full#22103
cmd/geth: Graceful shutdown if disk is full#22103holiman merged 10 commits intoethereum:masterfrom alex347:master
Conversation
Adding warnings of free disk space left and graceful shutdown when there is not enough space left.
|
Is this a replacement for #21884 ? |
|
Thanks for the work on it - but I think it would be better to do the changes in the old PR then - wondering why you opened a new one. Seems you know how to push to a existing PR. |
|
I don't think I can modify PR if I'm not the author of it? Do you mean pushing my changes to vyrwu:handle-full-disk ? |
|
Oh sorry - just saw that the other PR is not from you - you did everything good then. |
code formatting Co-authored-by: Martin Holst Swende <martin@swende.se>
changing free disk warn level; check free disk space once in a minute
| defer signal.Stop(sigc) | ||
|
|
||
| syncMode := *GlobalTextMarshaler(ctx, SyncModeFlag.Name).(*downloader.SyncMode) | ||
| if chainID.Int64() == 1 && syncMode != downloader.FastSync { |
There was a problem hiding this comment.
It's the light sync mode we want to make an exception for.
Still, I'm not 100% sure this is the best approach, I'll think about it.
|
Two comments from the triage:
|
holiman
left a comment
There was a problem hiding this comment.
This turned out pretty neat in the end, thanks for working on it!
It appears to work fine on linux, would be neat to get this tested on Windows, Darwin and/or FreeBsd too.
And potentially if the datadir is mapped via some other filesystem, like an NFS mount.
I've tested it and it works fine on Windows, Darwin and NFS mount |
if you really want to help: test it yourself instead of asking for proof from someone that put in really good work into this feature - also not sure what kind of elaboration is needed here |
Adding warnings of free disk space left and graceful shutdown when there is not enough space left. This also adds a flag datadir.minfreedisk which can be used to set the trigger for low disk space, and setting it to zero disables the check. Co-authored-by: Martin Holst Swende <martin@swende.se> Co-authored-by: Felix Lange <fjl@twurst.com>
|
How low is low? Is it % or MB? Is it possible to adjust this setting? |
Adding warnings of low free disk space left and graceful shutdown when there is not enough space left.