mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
Workload prioritization was added in scylladb/scylladb#22031. The functionality of updating service levels was implemented as a lambda coroutine, leaving room for the lambda coroutine fiasco. The problem was noticed and addressed in scylladb/scylladb#26404. There are currently three functions that call switch_tenant: - update_user_scheduling_group_v1 and update_user_scheduling_group_v2 use the deducing this (this auto self) to ensure the proper lifecycle of the lambda capture. - update_control_connection_scheduling_group doesn’t use the deducing this, but the lambda captures only `this`, which is used before the first possible coroutine preemption. Therefore, it doesn’t seem that any memory corruption or undefined behavior is possible here. Nevertheless, it seems better to start using the deducing this in update_control_connection_scheduling_group as well, to avoid problems in the future if someone modifies the code and forgets to add it. Fixes: SCYLLADB-284 Closes scylladb/scylladb#28158