Issue #2270491 by beeradb: wrap veriable_set to catch race condition and prevent errors