Fix race condition when starting up ZookeeperDnsWatcher. The race condition is that @dns will not exist by the time that @zk calls its reconfigure_callback, which in turn will call @dns.backends.
This was introduced in #333; since the ZK watchers will always discover first before completing start, they will always call reconfigure_callback on startup.
Testing
Previously during startup, this error was received when using ZookeeperDnsWatcher:
E, [2020-08-31T09:42:40.828903 #8859] ERROR -- Synapse::Synapse: synapse: encountered unexpected exception #<NoMethodError: undefined method `backends' for nil:NilClass> in main thread
Summary
Fix race condition when starting up
ZookeeperDnsWatcher
. The race condition is that@dns
will not exist by the time that@zk
calls itsreconfigure_callback
, which in turn will call@dns.backends
.This was introduced in #333; since the
ZK
watchers will always discover first before completingstart
, they will always callreconfigure_callback
on startup.Testing
Previously during startup, this error was received when using
ZookeeperDnsWatcher
:E, [2020-08-31T09:42:40.828903 #8859] ERROR -- Synapse::Synapse: synapse: encountered unexpected exception #<NoMethodError: undefined method `backends' for nil:NilClass> in main thread
Now, Synapse starts up properly.
Reviewers
@austin-zhu