Fixes #34248
Add is_running() check in NetworkThread.close() to prevent timeout when event loop is already stopped on NetBSD.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34334.
See the guideline for information on the review process. A summary of reviews will appear here.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
I think the problem is not that it is already stopped but that it does not stop within 10 seconds:
0AssertionError: Predicate ''''
1 wait_until_helper_internal(lambda: not self.network_event_loop.is_running(), timeout=timeout)
2''' not true after 10.0 seconds
=> is_running() keeps returning True after 10 seconds.