When using default servers as fallback, synapse is looking for a Zookeeper method
- Dominant language
- Ruby
- Stars
- 2.1k
- Forks
- 248
- PR merge metrics
- No merged PRs in 30d
Description
Not sure if I am doing something wrong, or if that is a bug, but here it is:
After synapse fails to fetch backends from Zookeeper, and it falls back to default server list, it is still trying to find method "shuffle"
```
W, [2014-06-06T20:24:36.814618 #14] WARN -- Synapse::ZookeeperWatcher: synapse: no backends for service application; using default servers: {"name"=>"default-app", "host"=>"111.111.111.111", "port"=>443}
I, [2014-06-06T20:24:36.817710 #14] INFO -- Synapse::Synapse: synapse: regenerating haproxy config
E, [2014-06-06T20:24:36.818293 #14] ERROR -- Synapse::Synapse: synapse: encountered unexpected exception #"default-app", "host"=>"111.111.111.111", "port"=>443}:Hash> in main thread
W, [2014-06-06T20:24:36.818395 #14] WARN -- Synapse::Synapse: synapse: exiting; sending stop signal to all watchers
W, [2014-06-06T20:24:36.818452 #14] WARN -- Synapse::ZookeeperWatcher: synapse: zookeeper watcher exiting
I, [2014-06-06T20:24:36.830512 #14] INFO -- Synapse::ZookeeperWatcher: synapse: zookeeper watcher cleaned up successfully
/usr/local/lib/ruby/gems/2.1.0/gems/synapse-0.10.0/lib/synapse/haproxy.rb:654:in `generate_backend_stanza': undefined method `shuffle' for {"name"=>"default-app", "host"=>"111.111.111.111", "port"=>443}:Hash (NoMethodError)
from /usr/local/lib/ruby/gems/2.1.0/gems/synapse-0.10.0/lib/synapse/haproxy.rb:551:in `block in generate_config'
from /usr/local/lib/ruby/gems/2.1.0/gems/synapse-0.10.0/lib/synapse/haproxy.rb:548:in `each'
from /usr/local/lib/ruby/gems/2.1.0/gems/synapse-0.10.0/lib/synapse/haproxy.rb:548:in `generate_config'
from /usr/local/lib/ruby/gems/2.1.0/gems/synapse-0.10.0/lib/synapse/haproxy.rb:534:in `update_config'
from /usr/local/lib/ruby/gems/2.1.0/gems/synapse-0.10.0/lib/synapse.rb:45:in `block in run'
from /usr/local/lib/ruby/gems/2.1.0/gems/synapse-0.10.0/lib/synapse.rb:37:in `loop'
from /usr/local/lib/ruby/gems/2.1.0/gems/synapse-0.10.0/lib/synapse.rb:37:in `run'
from /usr/local/lib/ruby/gems/2.1.0/gems/synapse-0.10.0/bin/synapse:60:in `'
from /usr/local/bin/synapse:23:in `load'
from /usr/local/bin/synapse:23:in `'
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at lib/synapse/haproxy.rb:654, generate_backend_stanza, and trace the default-server data passed when Zookeeper returns no backends. Reproduce the fallback path and verify that HAProxy configuration generation handles the default server entry without raising NoMethodError for shuffle.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100