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

client: make Redis::Client#ensure_connected handle fork reconnects #414

Merged
merged 1 commit into from Apr 2, 2014

Conversation

Projects
None yet
6 participants
@yaauie
Copy link
Member

yaauie commented Mar 14, 2014

If @reconnect is enabled and #ensure_connected is called in the forked child of
the process that established the connection, a reconnect attempt should be made;
handle this case like any other ConnectionError.

client: make Redis::Client#ensure_connected handle fork reconnects
If reconnect is enabled and ensure_connected is called in the forked child of
the process that established the connection, a reconnect attempt should be made;
handle this case like any other ConnectionError.
@saizai

This comment has been minimized.

Copy link

saizai commented Mar 14, 2014

+1

@saizai

This comment has been minimized.

Copy link

saizai commented Mar 14, 2014

See also #389 and #364.

@yaauie

This comment has been minimized.

Copy link
Member

yaauie commented Mar 14, 2014

It looks like the build failure is unrelated, and only on jruby-19mode conn=ruby REDIS_BRANCH=2.8:

 1) Failure:
test_resolves_localhost(TestInternals) [/home/travis/build/redis/redis-rb/test/internals_test.rb:347]:
Exception raised:
<#<Redis::CannotConnectError: Timed out connecting to Redis on localhost:6381>>.
@yaauie

This comment has been minimized.

Copy link
Member

yaauie commented Apr 2, 2014

Can I do anything to help this move forward?

@Bertg

This comment has been minimized.

Copy link

Bertg commented Apr 2, 2014

I was wondering if @pietern is not moving on this because of the work he is doing with the hiredis project.
Maybe this type of patch is not compatible with it; and he'd like to keep them in sync?

@pietern

This comment has been minimized.

Copy link
Member

pietern commented Apr 2, 2014

@Bertg This is compatible. The functionality in redis-rb is just a superset of the functionality in hiredis-rb.

@yaauie Thanks for this patch. It's the most elegant one I've seen so far to address this problem. The test failure you have seen is a flaky one. The JRuby ones fail every now and then, usually related to I/O errors or timeouts.

pietern added a commit that referenced this pull request Apr 2, 2014

Merge pull request #414 from yaauie/fork-child-auto-reconnect
client: make Redis::Client#ensure_connected handle fork reconnects

@pietern pietern merged commit 443873f into redis:master Apr 2, 2014

1 check failed

default The Travis CI build failed
Details
@Bertg

This comment has been minimized.

Copy link

Bertg commented Apr 2, 2014

Sweet. Thx @pietern and @yaauie.
Any indication when this will be released as a gem?

@yaauie yaauie deleted the yaauie:fork-child-auto-reconnect branch Apr 2, 2014

@rrauenza

This comment has been minimized.

Copy link

rrauenza commented Apr 30, 2014

+1 on the gem -- can we get a 3.0.8?

@yaauie

This comment has been minimized.

Copy link
Member

yaauie commented May 1, 2014

If there's anything I can do to assist in getting this into a release (any other bugs that need squashing or features that need completion/verification), I'd be more than willing to lend help.

@eljuanchosf

This comment has been minimized.

Copy link

eljuanchosf commented Jun 2, 2014

Guys, we are in desperate need of a 3.0.8 release with this fix. How can we help?

@yaauie yaauie added this to the v3.1 milestone Jun 4, 2014

@yaauie

This comment has been minimized.

Copy link
Member

yaauie commented Jun 6, 2014

This feature was released in 3.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment