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

Wait for a pending connection when acquiring #122

Merged
merged 1 commit into from Oct 13, 2015

Conversation

Projects
None yet
2 participants
@jbowes
Contributor

jbowes commented Sep 26, 2015

There are two cases when a caller might ask for a connection when the
only available ones are in a pending state:

  • Upon initialization, if the caller hasn't waited for connect() to
    complete.
  • After all connections to the database are lost, and they are
    reconnecting.

Instead of immediately returning an error to the caller, add them to the
waiting queue, allowing them to either get a connection, or return an
error if none of the pending connections succeed.

@haizaar

This comment has been minimized.

Collaborator

haizaar commented Sep 26, 2015

Nice catch. Can you please add unittests for the two cases you describe?

Thanks.

@jbowes

This comment has been minimized.

Contributor

jbowes commented Sep 26, 2015

Nice catch. Can you please add unittests for the two cases you describe?

Thanks :)

Sure can!

I'll try to add those in the next day or two.

@haizaar

This comment has been minimized.

Collaborator

haizaar commented Oct 5, 2015

Hi,
I'm kindly asking if you have update on this?

@jbowes

This comment has been minimized.

Contributor

jbowes commented Oct 5, 2015

Hi!

I've been away.
I did start trying to run the tests on OS X, but have had a lot of failures.

What do you use to develop/run the tests? maybe I'll have better luck in a VM of a similar setup.

@haizaar

This comment has been minimized.

Collaborator

haizaar commented Oct 5, 2015

I'm running on Ubuntu 14.04. Travis CI environment runs Ubuntu as well.
Please note that you need a gcc compiler available.

I suggest using Ubuntu 14.04 VM. Get it working on a single version of
Python, push the code and let Travis to run the full comparability matrix
for you.

Let me know if you need any further help.

On Mon, Oct 5, 2015 at 9:28 PM, James Bowes notifications@github.com
wrote:

Hi!

I've been away.
I did start trying to run the tests on OS X, but have had a lot of
failures.

What do you use to develop/run the tests? maybe I'll have better luck in a
VM of a similar setup.


Reply to this email directly or view it on GitHub
#122 (comment).

Zaar

@jbowes jbowes force-pushed the jbowes:wait-on-pending branch 2 times, most recently from 7eece3d to 510039d Oct 6, 2015

@jbowes

This comment has been minimized.

Contributor

jbowes commented Oct 6, 2015

updated with tests :)

@jbowes

This comment has been minimized.

Contributor

jbowes commented Oct 7, 2015

Makes sense to me!

I'll implement that and add a few tests to ensure callers will get exceptions.

@jbowes jbowes force-pushed the jbowes:wait-on-pending branch 2 times, most recently from 774a9b5 to e1bd43b Oct 7, 2015

Wait for a pending connection when acquiring
There are two cases when a caller might ask for a connection when the
only available ones are in a pending state:
- Upon initialization, if the caller hasn't waited for `connect()` to
  complete.
- After all connections to the database are lost, and they are
  reconnecting.

Instead of immediately returning an error to the caller, add them to the
waiting queue, allowing them to either get a connection, or return an
error if none of the pending connections succeed.

@jbowes jbowes force-pushed the jbowes:wait-on-pending branch from e1bd43b to a0391c2 Oct 7, 2015

@haizaar

This comment has been minimized.

Collaborator

haizaar commented Oct 12, 2015

Another gentle ping :)

@jbowes

This comment has been minimized.

Contributor

jbowes commented Oct 13, 2015

Oh!

It's all updated and passing... I forgot to leave a comment though 😿

haizaar added a commit that referenced this pull request Oct 13, 2015

Merge pull request #122 from jbowes/wait-on-pending
Wait for a pending connection when acquiring

@haizaar haizaar merged commit 3671d84 into FSX:master Oct 13, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@haizaar

This comment has been minimized.

Collaborator

haizaar commented Oct 13, 2015

Thank you!

@jbowes

This comment has been minimized.

Contributor

jbowes commented Oct 13, 2015

My pleasure:)

@jbowes jbowes deleted the jbowes:wait-on-pending branch Oct 13, 2015

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