awslabs / amazon-kinesis-video-streams-pic

Apache License 2.0
49 stars 47 forks source link

Threadpool tsan #238

Closed jdelapla closed 7 months ago

jdelapla commented 8 months ago

Issue #, if available: N/A

Description of changes: ThreadData->mutex now wraps all interactions with any threadpool objects, this includes the queue. As a consequence of having the data mutex locked while waiting on the queue, the threadpool couldn't teardown if an actor was waiting on the queue, so the teardown now pushes wait tasks to the queue in the event of that use case.

Additionally all utils tests were changed so that if a memory leak is detected, it will infinitely wait for the memory leak to end -- resulting in a GHA timeout or a loose actor cleaning up the memory (common race condition specific to tests only).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov-commenter commented 7 months ago

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (792e0db) 80.42% compared to head (c3fb240) 80.40%.

:exclamation: Current head c3fb240 differs from pull request most recent head 248c90f. Consider uploading reports for the commit 248c90f to get more accurate results

Files Patch % Lines
src/utils/src/Threadpool.c 73.68% 20 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #238 +/- ## =========================================== - Coverage 80.42% 80.40% -0.02% =========================================== Files 52 52 Lines 10762 10810 +48 =========================================== + Hits 8655 8692 +37 - Misses 2107 2118 +11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

disa6302 commented 7 months ago

Can we open a PR in WebRTC to confirm the CI there passes too?