Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sentinel] update master address if it changes. #847

Merged
merged 1 commit into from
May 20, 2020

Conversation

jhgg
Copy link
Contributor

@jhgg jhgg commented Mar 24, 2017

Otherwise we'll end up spamming the connection pool because each time the master is discovered, it'll trigger the disconnect of the pool - as self.master_address never gets updated.

Otherwise we'll end up spamming the connection pool because each time the master is discovered, it'll trigger the disconnect of the pool - as `self.master_address` never gets updated.
@rolette
Copy link

rolette commented Sep 15, 2017

Can we get this merged to master? SentinelConnectionPool eventually ends up causing OSError 99's under load.

The connections in the pool all become one-shot connections if the master moves. When those connections are flushed quickly like that, you end up with tons of connections in TIME_WAIT state. Eventually this leads to having no source ports available for your connection, which results in this error:

redis.exceptions.ConnectionError: Error 99 connecting to 100.64.0.3:6379. Cannot assign requested address.

@phenomax
Copy link

LGTM!

@nickwilliams-eventbrite

+1 here. Really need this merged. Having to monkey-patch.

@avgerin0s
Copy link

@andymccurdy Are there any plans on merging this?

@jhgg
Copy link
Contributor Author

jhgg commented Feb 1, 2019

@andymccurdy bump on this one!

@jobec
Copy link

jobec commented Feb 19, 2019

Would be great if it could be merged.

We're running into issues when running a lot of tasks in Celery with Gevent and Redis as it's result backend. Whenever the master moves, we get errors like these (only a restart of Celery fixes it):

  • ConcurrentObjectUseError: This socket is already used by another greenlet: <bound method Waiter.switch of <gevent.__waiter.Waiter object at 0x7efcfb1eab38>>
  • AttributeError: 'NoneType' object has no attribute 'sendall'
  • ConnectionError: Error 32 while writing to socket. Broken pipe.
  • ConnectionError: Error 9 while writing to socket. File descriptor was closed in another greenlet.
  • ConnectionError: Error 104 while writing to socket. Connection reset by peer.

We waited until 3.2.0 to see if it fixed things but it didn't. By applying this patch, all tasks run fine again after a master move. (Except the first task after the move, complaining about "connection reset by peer")

@samschlegel
Copy link

@andymccurdy Could we get this merged?

@andymccurdy
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants