-
Notifications
You must be signed in to change notification settings - Fork 356
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
Flush count overflow issue mitigation #212
base: master
Are you sure you want to change the base?
Conversation
electrumx/server/env.py
Outdated
@@ -76,7 +76,8 @@ def __init__(self, coin=None): | |||
self.blacklist_url = self.default('BLACKLIST_URL', self.coin.BLACKLIST_URL) | |||
self.cache_MB = self.integer('CACHE_MB', 1200) | |||
self.reorg_limit = self.integer('REORG_LIMIT', self.coin.REORG_LIMIT) | |||
|
|||
self.history_flush_count_max = self.integer('HISTORY_FLUSH_COUNT_MAX', 60000) # deactivated if > 65535 |
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.
What is the point of this env var? Why would one set it to lower than 65535?
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.
Assume you want to do an urgent transaction via your private electrumx server but notice it's down. Instead of waiting for hours you can just increase that value and proceed. Of course you will have to compact eventually. I thought that would be a nice option and it is not too much effort. I hope I got the way of passing the environment info right along the rest, so far I have only seen this using shared config modules.
I moved the exception to the end of the flush function so that the current work will still be flushed. Will update the PR after testing. |
Cleaned up a bit. Finally the last flush should work, too. I am thinking about adding a sys.exit(8) code so that it is easier to deal with the error from shell. Or maybe writing the flush count to a file. @SomberNight let me know if that sounds interesting at all. |
History autocompact sh
Hopefully this can save users some effort. Needs more testing.