-
Notifications
You must be signed in to change notification settings - Fork 2k
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
shutdown the weight proof process pool #10163
Conversation
This code was recently changed as part of the new wallet, and it did not get much testing. So it makes sense that there might be a bug here |
chia/full_node/weight_proof.py
Outdated
byte_chunks = [] | ||
for vdf_proof, classgroup, vdf_info in chunk: | ||
byte_chunks.append((bytes(vdf_proof), bytes(classgroup), bytes(vdf_info))) | ||
with ProcessPoolExecutor(self._num_processes) as executor: |
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.
do we spin up these processes every time we validate a weight proof? It seems like we should just keep this ProcessPoolExecutor
around, but maybe we only validate weight proofs very rarely.
Either way, probably not for this PR
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.
Yeah, I asked about this and Mariano said it was fine to just recreate the pool.
Thanks for looking. There's a 'bunch' more coming on this. It's basically the same situation as with the weight proof process pool in #9050. This will get another temp file to trigger shutdown of the work in the subprocesses since the executor can't handle such cancellation. |
Sometimes when we shutdown with
chia stop -d all
we get 4chia_full_node
processes floating around unclosed.Issues:
await asyncio.sleep(0)
to take turns. It is called cooperative concurrency after all.FullNode._await_closed()
toFullNode._close()
FullNode._await_closed()
along with consuming the cancellation at that point since we are already shutting down there.signal.signal()
function instead of integrating itself with asyncio signal handling viaasyncio.get_running_loop().add_signal_handler()
. It seems this would end up either overriding other signal handlers or being overridden by them depending on order of execution. Neither seem good.Draft for:
set -vx; while true; do echo "about to start $(date --iso-8601=n)"; which chia; chia start node; sleep 30; echo "about to stop $(date --iso-8601=n)"; chia stop -d all; sleep 5; ps aux | grep chia_; pkill -9 chia_; done