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

Save database upon graceful exit #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peterzen
Copy link

Dump dnsseed.dat on SIGINT
Solves #76

main.cpp Outdated Show resolved Hide resolved
@@ -334,39 +334,58 @@ int StatCompare(const CAddrReport& a, const CAddrReport& b) {
}
}

bool isDumpDbRunning = false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this function is signal safe: https://man7.org/linux/man-pages/man7/signal-safety.7.html

In particular, it indirectly performs memory allocations. Generally the approach is setting just a flag in the handler itself, and having a main processing thread detect the flag and process it.

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.

3 participants