confluentinc / ducktape

System integration and performance tests
10 stars 93 forks source link

handle edge case when wait is called on BackgroundThread that has never been started #371

Closed stan-is-hate closed 1 year ago

stan-is-hate commented 1 year ago

If BackgroundThread object has never been started, calling wait() on it will crash since worker_threads won't contain a thread for this worker. This PR adds a safety check around that case.

We discovered it the hard way, with confluent kafka system tests. Debugging this issue was not straightforward for some reason, since the exception is silenced by ducktape (this is another problem not tackled by this PR).

This PR also adds a couple of useful debug lines which we added when debugging an issue with confluent system tests.

stan-is-hate commented 1 year ago

Thanks @imcdo ! As a heads up, I'll merge this into 0.11.x and release as a hotfix 0.11.2 version - there are other big changes in the next release