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

Flush count overflow issue mitigation #212

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

ghoober
Copy link

@ghoober ghoober commented Apr 27, 2023

Hopefully this can save users some effort. Needs more testing.

@@ -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
Copy link
Member

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?

Copy link
Author

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.

@ghoober
Copy link
Author

ghoober commented Apr 30, 2023

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.

@ghoober
Copy link
Author

ghoober commented May 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants