Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to automatically reconnect after network issues or database server restart?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 27 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 22 2012, 2:47 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Mon, 22 Oct 2012 16:47:21 -0200
Local: Mon, Oct 22 2012 2:47 pm
Subject: How to automatically reconnect after network issues or database server restart?
I had to restart the PostgreSQL service in our database server and the
Rails apps using Sequel stopped working.

Is there a way to instruct Sequel to try to reconnect on such cases? One
that works both for MRI and JRuby?

Thanks in advance,

Rodrigo.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Evans  
View profile  
 More options Oct 22 2012, 5:34 pm
From: Jeremy Evans <jeremyeva...@gmail.com>
Date: Mon, 22 Oct 2012 14:34:26 -0700 (PDT)
Local: Mon, Oct 22 2012 5:34 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

On Monday, October 22, 2012 11:47:29 AM UTC-7, Rodrigo Rosenfeld Rosas
wrote:

> I had to restart the PostgreSQL service in our database server and the
> Rails apps using Sequel stopped working.

> Is there a way to instruct Sequel to try to reconnect on such cases? One
> that works both for MRI and JRuby?

Sequel should be removing the connections from the pool, reraising the
exceptions, and creating new connections as needed in the future.  So it's
expected that some DatabaseDisconnectErrors will be raised, but Sequel
should recover, assuming that it correctly recognizes the disconnections
(which it should on the postgres and jdbc/postgres adapters).  If that
isn't what you experienced, please try to put together a reproducible test
case and I'll take a look.

Thanks,
Jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 22 2012, 9:20 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Mon, 22 Oct 2012 18:20:41 -0700 (PDT)
Local: Mon, Oct 22 2012 9:20 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em segunda-feira, 22 de outubro de 2012 19h34min26s UTC-2, Jeremy Evans
escreveu:

But this is a problem for our setup as we have a cluster with a dozen
servers and there will be as many reported errors as there are servers in
the cluster and all of them end up in our SLA errors log which affects our
contract :(

Is there a way of just instructing Sequel to query something like "select
1" before attempting to use the connection? Hibernate has an option to do
so and it works. Our application is a mix of a Grails and a Rails app. We
only had to restart the Rails servers of the cluster as the Grails ones
that used Hibernate with this option enabled didn't experience any issues.

We'd like to be able to do something like with Sequel as well.

Would that be possible?

Thanks,
Rodrigo.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Evans  
View profile  
 More options Oct 23 2012, 12:09 pm
From: Jeremy Evans <jeremyeva...@gmail.com>
Date: Tue, 23 Oct 2012 09:09:25 -0700 (PDT)
Local: Tues, Oct 23 2012 12:09 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

It's actually something I'm planning to implement as a extension very
soon.  The recently committed refactoring of the database <-> connection
pool interface is the first step, I need to add code to check connections
for validity and then an extension that automatically checks connections
for validity when they are checked out from the pool.

Note that restarting your app servers whenever you restart your database
server has been the recommended way for a long time.  The extension I'm
planning to implement is mostly to handle inactive connections in the pool
that get timed out and disconnected by the database.  If you have control
over when your database server restarts, it shouldn't be difficult to make
sure your app servers are restarted at the same time.

Jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 23 2012, 12:10 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Tue, 23 Oct 2012 09:10:41 -0700 (PDT)
Local: Tues, Oct 23 2012 12:10 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em segunda-feira, 22 de outubro de 2012 23h20min41s UTC-2, Rodrigo
Rosenfeld Rosas escreveu:

By the way, Java libraries usually refer to this feature as "test on
borrow":

http://commons.apache.org/pool/api-1.6/org/apache/commons/pool/impl/G...)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 23 2012, 2:06 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Tue, 23 Oct 2012 16:06:18 -0200
Local: Tues, Oct 23 2012 2:06 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em 23-10-2012 14:09, Jeremy Evans escreveu:

It is a bit tricky actually because I need some tool to ssh over all
servers in the cluster and ask them to restart. Also, using it this way
causes some downtime and loading the Rails app is much slower than
restarting the PostgreSQL database (which happens in within a second).

No downtime was reported when we restarted the database from the Grails
app, but we had issues with the Rails app.

Anyway, it is good to know that you're working on such an extension.
Looking forward to it.

Thanks,
Rodrigo.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Evans  
View profile  
 More options Oct 23 2012, 6:28 pm
From: Jeremy Evans <jeremyeva...@gmail.com>
Date: Tue, 23 Oct 2012 15:28:47 -0700 (PDT)
Local: Tues, Oct 23 2012 6:28 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

The code to check connections for validity has been pushed.  I have the
extension that automatically checks connections for validity on pool
checkout written and apparently working based on the integration-level
tests, but I still need to add documentation and extension-level tests.  I
expect that the extension will be pushed to the master branch sometime
tomorrow.

Jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 23 2012, 8:04 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Tue, 23 Oct 2012 22:04:05 -0200
Local: Tues, Oct 23 2012 8:04 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?
Em terça-feira 23 outubro 2012, às 20:28:47, Jeremy Evans escreveu:

Wow! This is really great news! Thank you so much!

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 24 2012, 8:49 am
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Wed, 24 Oct 2012 05:49:46 -0700 (PDT)
Local: Wed, Oct 24 2012 8:49 am
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em terça-feira, 23 de outubro de 2012 22h04min13s UTC-2, Rodrigo Rosenfeld
Rosas escreveu:

By the way, I hope this will help me with another issue I'm having.
Yesterday I had to restart the Rails apps because of EBADF (Bad File
Descriptor) errors in a Sequel line like "User[id]". For some reason we're
having some troubles with our connection to the PG server even when we
don't restart the server. :(

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 24 2012, 9:07 am
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Wed, 24 Oct 2012 06:07:57 -0700 (PDT)
Local: Wed, Oct 24 2012 9:07 am
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em quarta-feira, 24 de outubro de 2012 10h49min46s UTC-2, Rodrigo Rosenfeld
Rosas escreveu:

Another thing to consider is removing all connections from the pool when a
connection error is detected in one of them. Most likely it will happen
with the other ones as well. For instance if you restart the PG server, all
connections will become invalid. But still Sequel calls will fail 50 times
consecutively if there are 50 connections in the pool. Maybe there should
be an option to clear the pool once it has been detected some problem in
any of the connections. Maybe that could be the default behavior. Does it
make sense?

For example, suppose you have a 10 servers cluster and each one has a pool
size of 50. There will be 500 failed requests after restarting a PG
database or some similar issue that could cause the connections to be
killed.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Evans  
View profile  
 More options Oct 24 2012, 11:38 am
From: Jeremy Evans <jeremyeva...@gmail.com>
Date: Wed, 24 Oct 2012 08:38:36 -0700 (PDT)
Local: Wed, Oct 24 2012 11:38 am
Subject: Re: How to automatically reconnect after network issues or database server restart?

On Wednesday, October 24, 2012 6:07:58 AM UTC-7, Rodrigo Rosenfeld Rosas
wrote:

> Another thing to consider is removing all connections from the pool when a
> connection error is detected in one of them. Most likely it will happen
> with the other ones as well. For instance if you restart the PG server, all
> connections will become invalid. But still Sequel calls will fail 50 times
> consecutively if there are 50 connections in the pool. Maybe there should
> be an option to clear the pool once it has been detected some problem in
> any of the connections. Maybe that could be the default behavior. Does it
> make sense?

It makes sense as an option, but not as the default behavior (I'll consider
patches, but won't work on it myself).  I don't think very many people are
doing what you are doing (restarting the database while the application is
running).  Personally, I consider that a bad idea.  The problem that far
more people have (I'm guessing based on reported issues) is that idle
connections in the connection pool get disconnected by the database after a
period of time.  In that case, removing all connections from the pool just
because a single one idled out is definitely the wrong approach.

Note that with the connection verification extension I'm working on, you
can verify connections on pool checkout before use, so your only chance of
issues there is a disconnect while a connection is checked out (in which
case I don't think anything could help).  Of course, this can result in a
performance hit, especially if you aren't attempting to manage connection
checkouts manually in a coarse manner (e.g. in a rack middleware).  Using
coarse connection checkouts hurts multithreaded use, basically limiting the
number of concurrent web requests to the number of database connections, so
there is a definite tradeoff in that area.

Jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 24 2012, 12:50 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Wed, 24 Oct 2012 09:50:30 -0700 (PDT)
Local: Wed, Oct 24 2012 12:50 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em quarta-feira, 24 de outubro de 2012 13h38min36s UTC-2, Jeremy Evans
escreveu:

In the meanwhile I'm just monkey patching Sequel 3.35.0:

# Patch Sequel to try the connection first before using it
class Sequel::ThreadedConnectionPool < Sequel::ConnectionPool
  private
  def available
    begin
      (@available_connections.pop || make_new(DEFAULT_SERVER)).tap{|c|
c.execute 'select 1' }
    rescue
      # reconnects on invalid connection (disconnected for some reason)
      DB.disconnect
      DB.pool.all_connections{}
      @available_connections.pop
    end
  end
end

This works for me, but as soon as you get your extension released I'll
change to it :)

There are other reasons for the connections to be closed. I don't often
restart my database and only did that once because I was restoring a dump
from another server into this one and I needed to rename the database to
database-old and database-new to database but I had to kill all connections
to the database first before being able to rename them. I didn't have much
time to investigate how to do that in that time so I just restarted the pg
service. Now I'd probably use this instead:

https://github.com/rosenfeld/command-reference/blob/master/en/databas...

But I had this disconnection issue yesterday again even not restarting the
database. I don't know the cause yet, but while researching the subject,
one possible reason could be that a switch is killing idle connections
after a while. So, suppose PostgreSQL keep alive is set to 2h and the
switch is set to kill TCP connections idle for 15 minutes. All connections
could be invalid after a while where no one is using the database (at
night, for instance). I don't know if that is our case though and I'm still
investigating what could be causing the connections to become invalid
sometimes. I'm just saying that the testOnBorrow option available in most
Java libraries proved to be pretty useful in cases like this. So I'm
willing to accept a minimum overhead (select 1) to avoid such kind of
problems in my Ruby applications as well. For now the monkey patch above is
working for me, but I'd prefer to use your extension when it is ready.

I'm just saying that I can think of more reasons for a connection to become
invalid even when not restarting the database. In most cases I think it
would affect all connections instead of a single one. Another option would
be someone replacing a switch with another one...

Thanks,
Rodrigo.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 24 2012, 5:16 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Wed, 24 Oct 2012 14:16:54 -0700 (PDT)
Local: Wed, Oct 24 2012 5:16 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em quarta-feira, 24 de outubro de 2012 14h50min31s UTC-2, Rodrigo Rosenfeld
Rosas escreveu:

Actually it doesn't. Just realized that after trying to deploy it on
JRuby/GlassFish. Thread reentrant locking related issues on this method :(

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Evans  
View profile  
 More options Oct 24 2012, 7:14 pm
From: Jeremy Evans <jeremyeva...@gmail.com>
Date: Wed, 24 Oct 2012 16:14:42 -0700 (PDT)
Local: Wed, Oct 24 2012 7:14 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

On Tuesday, October 23, 2012 3:28:47 PM UTC-7, Jeremy Evans wrote:
> The code to check connections for validity has been pushed.  I have the
> extension that automatically checks connections for validity on pool
> checkout written and apparently working based on the integration-level
> tests, but I still need to add documentation and extension-level tests.  I
> expect that the extension will be pushed to the master branch sometime
> tomorrow.

OK, the extension has been pushed up to GitHub, give it a shot and let me
know how it works for you:
https://raw.github.com/jeremyevans/sequel/master/lib/sequel/extension...

Jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 24 2012, 8:41 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Wed, 24 Oct 2012 17:41:59 -0700 (PDT)
Local: Wed, Oct 24 2012 8:41 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em quarta-feira, 24 de outubro de 2012 21h14min42s UTC-2, Jeremy Evans
escreveu:

Awesome! Thanks! I have a tight deadline for delivering some features for
tomorrow afternoon and I'll be working all this night on that. After the
demo happening tomorrow I'll be able to check this extension. Fortunately
we didn't experience any issues today like we did yesterday but we still
don't know what caused them and it is really bad to us when they happen.
That is why I'd like to get this extension set up soon before we get more
issues like Yesterday's.

I'll let you know tomorrow how it works for us. Thank you very much!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 26 2012, 12:44 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Fri, 26 Oct 2012 09:44:05 -0700 (PDT)
Local: Fri, Oct 26 2012 12:44 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em quarta-feira, 24 de outubro de 2012 21h14min42s UTC-2, Jeremy Evans
escreveu:

> On Tuesday, October 23, 2012 3:28:47 PM UTC-7, Jeremy Evans wrote:

>> The code to check connections for validity has been pushed.  I have the
>> extension that automatically checks connections for validity on pool
>> checkout written and apparently working based on the integration-level
>> tests, but I still need to add documentation and extension-level tests.  I
>> expect that the extension will be pushed to the master branch sometime
>> tomorrow.

> OK, the extension has been pushed up to GitHub, give it a shot and let me
> know how it works for you:
> https://raw.github.com/jeremyevans/sequel/master/lib/sequel/extension...

I gave it a try this afternoon but I had some issues using it on JRuby with
the jdbc-postgres driver and PG 9.2:

https://github.com/jruby/activerecord-jdbc-adapter/issues/251

So I created another gem for the meanwhile:

https://github.com/rosenfeld/jdbc-postgresql

With the new 9.2 JDBC4 driver I didn't have any issues and your extension
is working great!

Amazing job. Thank you very much! We had issues again this morning and I'm
hoping the new version we're going to release with your extension should
stop the errors from happening. Our partner is really sad about this issue
and your work on this extension may save our asses :)

Thank you very much!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 26 2012, 2:21 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Fri, 26 Oct 2012 11:21:06 -0700 (PDT)
Local: Fri, Oct 26 2012 2:21 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em sexta-feira, 26 de outubro de 2012 14h44min06s UTC-2, Rodrigo Rosenfeld
Rosas escreveu:

Unfortunately I'm still having troubles when deploying on JRuby :(

When I call Devise's authenticate_user from my controller I get this:

ThreadError Exception: Mutex relocking by same thread

I'm trying to debug into Devise's internal now to understand what is
happening but it seems that ruby-debug is a bit broken too on JRuby 1.7:

http://jira.codehaus.org/browse/JRUBY-6969

Well, it couldn't be that easy after all :) Wish me luck with my debugging
session.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 26 2012, 3:01 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Fri, 26 Oct 2012 12:01:07 -0700 (PDT)
Local: Fri, Oct 26 2012 3:01 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em sexta-feira, 26 de outubro de 2012 16h21min06s UTC-2, Rodrigo Rosenfeld
Rosas escreveu:

I could get a better stack-trace to demonstrate the issue I'm having:

https://gist.github.com/fb91c2357a42568ec27f

Is it possible to avoid calling sync inside another sync call? It doesn't
seem to work with JRuby...

Or am I doing something wrong?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Evans  
View profile  
 More options Oct 26 2012, 3:06 pm
From: Jeremy Evans <jeremyeva...@gmail.com>
Date: Fri, 26 Oct 2012 12:06:15 -0700 (PDT)
Local: Fri, Oct 26 2012 3:06 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

On Friday, October 26, 2012 12:01:08 PM UTC-7, Rodrigo Rosenfeld Rosas
wrote:

> I could get a better stack-trace to demonstrate the issue I'm having:

> https://gist.github.com/fb91c2357a42568ec27f

> Is it possible to avoid calling sync inside another sync call? It doesn't
> seem to work with JRuby...

> Or am I doing something wrong?

Nope, that's a bug.  I guess I'll need to make sure that the cached SQL
query is already available, such a check can't be delayed until runtime.

I'll push a fix as soon as I have one tested.

Thanks for testing!

Jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 26 2012, 3:07 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Fri, 26 Oct 2012 12:07:36 -0700 (PDT)
Local: Fri, Oct 26 2012 3:07 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em sexta-feira, 26 de outubro de 2012 17h06min15s UTC-2, Jeremy Evans
escreveu:

Thank you so much for all your amazing support!

Cheers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 26 2012, 3:16 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Fri, 26 Oct 2012 12:16:02 -0700 (PDT)
Local: Fri, Oct 26 2012 3:16 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em sexta-feira, 26 de outubro de 2012 17h07min37s UTC-2, Rodrigo Rosenfeld
Rosas escreveu:

Just to let you know, it seems a Monitor is reentrant if you want to take
this path:

http://japgolly.blogspot.com.br/2012/04/ruby-mutex-reentrancy.html

Best,
Rodrigo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Evans  
View profile  
 More options Oct 26 2012, 3:42 pm
From: Jeremy Evans <jeremyeva...@gmail.com>
Date: Fri, 26 Oct 2012 12:42:36 -0700 (PDT)
Local: Fri, Oct 26 2012 3:42 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

On Friday, October 26, 2012 12:16:02 PM UTC-7, Rodrigo Rosenfeld Rosas
wrote:

> Just to let you know, it seems a Monitor is reentrant if you want to take
> this path:

> http://japgolly.blogspot.com.br/2012/04/ruby-mutex-reentrancy.html

I'm aware of the difference, Mutex is being used on purpose for performance
(Monitor is about 2.5x slower).

One other limitation with the current code is that it does the connection
validation while holding the pool mutex, which means that no other threads
can checkout a connection while this connection is being validated.  That's
very bad.  I've modified things so the checking is done while not holding
the mutex (in addition to precaching the SQL).

I'm just running the changes through a final set of tests, hopefully it
will be pushed within 15 minutes.

Jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 26 2012, 3:44 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Fri, 26 Oct 2012 17:44:51 -0200
Local: Fri, Oct 26 2012 3:44 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em 26-10-2012 17:42, Jeremy Evans escreveu:

Great, specially because I tried using a Monitor instead of Mutex and
now "rails server" segfaults on JRuby 1.7 :P

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Evans  
View profile  
 More options Oct 26 2012, 4:00 pm
From: Jeremy Evans <jeremyeva...@gmail.com>
Date: Fri, 26 Oct 2012 13:00:44 -0700 (PDT)
Local: Fri, Oct 26 2012 4:00 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

I just pushed the fix:
https://github.com/jeremyevans/sequel/commit/40bcfcb9ff5b39c882c20479...

Please test and let me know whether it works for you.  Thanks for testing!

Jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 26 2012, 4:02 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Fri, 26 Oct 2012 18:02:24 -0200
Local: Fri, Oct 26 2012 4:02 pm
Subject: Re: How to automatically reconnect after network issues or database server restart?

Em 26-10-2012 18:00, Jeremy Evans escreveu:

I'll do it right now, thanks!

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 27   Newer >
« Back to Discussions « Newer topic     Older topic »