airbnb / synapse

A transparent service discovery framework for connecting an SOA
MIT License
2.07k stars 251 forks source link

[synapse] fix bug in generate_backend_stanze #242

Closed lap1817 closed 7 years ago

lap1817 commented 7 years ago

to: @jolynch

what

A bug was introduced into the generate_Backend_stanza. @state_cache.backends is expecting watcher.name as the input argument, but it got the watcher object. With the bug, when Synapse generates the haproxy config, it only sees the "enabled" services as reported by the watchers, but does not see all known backends in the state cache (because search by 'watch', instead of watcher.name, in the state cache failed silently). This increases number of haproxy restarts when Synapse is restarted.

fix

Pass the correct argument to @state_cache.backends

test

Added rspec test to cover this bug.

lap1817 commented 7 years ago

@jolynch , I am also removing Travis build on rvm 1.9.3-p551. Travis CI is having odd failures. I made a testing PR which only changed the README file, but still got the same CI build failure on rvm 1.9.30p551. https://github.com/airbnb/synapse/pull/243

The error is likely due to the old version of bundler (1.7.6) being used (other builds use 1.15.4). I found a discussion thread related to this: https://github.com/bundler/bundler/issues/3558. Seems that the issue is fixed in bundler version after 1.7.15.

I tried to enforce upgrading bundle in travis CI before bundle install. But it didn't work either.

So I am removing the build on rvm 1.9.3.

PTAL

jolynch commented 7 years ago

@lap1817 I just merged a workaround (upgrade bundler before_install), can you pull master and keep 1.9?

lap1817 commented 7 years ago

sure. doing it. odd that it didn't work for me

jolynch commented 7 years ago

Thanks @lap1817, I'll cut a bug fix release in a sec.

lap1817 commented 7 years ago

thank you @jolynch

jolynch commented 7 years ago

0.15.1 cut with the fix, cheers.