vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.42k stars 2.08k forks source link

Table throttler: unit test race condition #14852

Closed shlomi-noach closed 8 months ago

shlomi-noach commented 8 months ago

Reported by @harshit-gangal , for example in https://github.com/vitessio/vitess/actions/runs/7299836104/job/19894003119?pr=14851, we see a race condition in the table throttler's unit tests, while iterating the configured MySQL clusters.

The root cause of the race is that the throttler uses a global configuration instance, and the different tests all read/write to that same configuration instance. While 1st test still maintains some open timers (soon to be terminated by cancelled context), 2nd test already begins.

While it will be nice for 1st test's throttler's timers to terminate earlier, something we will look into, it's more important to isolate the throttler's configuration.

shlomi-noach commented 8 months ago

Duplicate of https://github.com/vitessio/vitess/issues/14776