Re: Coverity report Oct 31st, 2024 (Issue #40991)
- Rework of worker threads' start and exit
- Slight changes in cleanup code
Handles issue #40991
Merge request reports
Activity
requested review from @ahf
changed milestone to %Tor: 0.4.8.x-post-stable
- Resolved by excurso
Wow, this is some work. So, because of the nature of the change, especially implicating locking, we'll have to put this in 0.4.9.x as 0.4.8 is stable...
IF you can and want, you could come up with a minimal MR for the coverity fixes for 0.4.8 and we keep this for 0.4.9?
changed milestone to %Tor: 0.4.9.x-freeze
- Resolved by excurso
@excurso So upstream main CI pipeline caught this:
https://gitlab.torproject.org/tpo/core/tor/-/jobs/771496#L4671
Seems somehow
threadpool_start_threads()
failed... ?"Warning: Failed to confirm worker threads' start up after timeout. Number: 1"
UPDATE: I'm going to revert the commit until we figure this one out so I can release an alpha today.
Edited by David Goulet
added 1 commit
- b2ba59f3 - Rework of worker threads' start and exit + slight changes in cleanup code
added 1 commit
- 7e21b4c5 - Rework of worker threads' start and exit + slight changes in cleanup code
- Resolved by excurso
added 1 commit
- 5741967a - Rework of worker threads' start and exit + slight changes in cleanup code
Switched from temporary mutex to
pool->control_lock
. Don't know, why I haven't done it previously. Was overloaded that dayThe current version also seems to be robust, passes all tests and debug log looks good:
[debug] threadpool_start_threads(): Starting worker threads... │ [debug] worker_thread_main(): Worker thread 1/8 has started [TID: 139827143562944]. [debug] worker_thread_main(): Worker thread 2/8 has started [TID: 139827135170240]. [debug] worker_thread_main(): Worker thread 3/8 has started [TID: 139827126777536]. [debug] worker_thread_main(): Worker thread 4/8 has started [TID: 139827118384832]. [debug] worker_thread_main(): Worker thread 5/8 has started [TID: 139827109992128]. [debug] worker_thread_main(): Worker thread 6/8 has started [TID: 139827101599424]. [debug] worker_thread_main(): Worker thread 7/8 has started [TID: 139826753959616]. [debug] worker_thread_main(): Worker thread 8/8 has started [TID: 139826745566912]. [debug] threadpool_start_threads(): Starting worker threads finished. [debug] threadpool_start_threads(): Signaled the worker threads to enter the work loop. [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827143562944]. [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827135170240]. [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827118384832]. [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827126777536]. [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827109992128]. [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827101599424]. [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139826753959616]. [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139826745566912].
Sent
SIGTERM
to thetor
process here.[debug] threadpool_stop_threads(): Signaled worker threads to exit. Waiting for them to exit... [debug] worker_thread_main(): Worker thread 1/8 has exited [TID: 139827118384832]. [debug] worker_thread_main(): Worker thread 2/8 has exited [TID: 139827101599424]. [debug] worker_thread_main(): Worker thread 3/8 has exited [TID: 139826753959616]. [debug] worker_thread_main(): Worker thread 4/8 has exited [TID: 139827135170240]. [debug] worker_thread_main(): Worker thread 5/8 has exited [TID: 139827109992128]. [debug] worker_thread_main(): Worker thread 6/8 has exited [TID: 139827143562944]. [debug] worker_thread_main(): Worker thread 7/8 has exited [TID: 139827126777536]. [debug] worker_thread_main(): Worker thread 8/8 has exited [TID: 139826745566912]. [debug] threadpool_stop_threads(): All worker threads have exited. [debug] threadpool_free_(): Beginning to clean up... [debug] threadpool_free_(): Cleanup finished.