[R-sig-DB] RMySQL doesn't auto-reconnect
Paul Gilbert
pg||bert @end|ng |rom b@nk-b@nque-c@n@d@@c@
Fri Aug 28 19:39:36 CEST 2009
Jack Tanner wrote:
> Unfortunately, the server in question is on a web host, so I almost
> certainly have no control of time-out parameters, even just to play with
> to test the hypothesis. The loss of connection usually happens within
> seconds, not even tens of seconds. Connecting from a different client
> machine still results in "server has gone away."
My guess is that this is not a time-out problem. If you can arrage to
temporarly connect without the firewall in the middle then at least you
could determine if the problem is the server or the firewall.
>
> I agree that auto-reconnect is a kludge, but I don't really know how to
> diagnose the failure of the connection. Ideas welcome. :)
>
> Could you clarify why auto-reconnect is dangerous security-wise?
I was assuming a situation that may not apply: if you use a
userid/password to connect then you should probably worry about how easy
it is to reconnect to a session that has been disconnected because it
has been idle for awhile. (But I was thinking hours not seconds.)
Paul
>
> Paul Gilbert wrote:
>
>> Jack
>>
>> It is possible this is a firewall, but I think there is also a
>> connection timeout parameter on the server, which can be adjusted. I'm
>> not sure what the default is, but I don't usually have trouble unless
>> I leave a connection sitting idle overnight. Probably the firewall has
>> some sort of connection timeout too. I think both these timeouts
>> should depend on idle time, so are not consistent with the problem you
>> report.
>>
>> Auto-reconnect would fix your problem, but I don't think you should be
>> getting dropped in the first place, unless you are really leaving the
>> connection idle for a long time. If you are doing that, I would not
>> recommend auto-reconnect (for security reasons).
>>
>> Paul
>>
>> Jeffrey Horner wrote:
>>
>>> Jack Tanner wrote:
>>>
>>>> After I do library(RMySQL), dbConnect(), and run a few queries, I
>>>> sometimes get this:
>>>>
>>>> Error in mysqlExecStatement(conn, statement, ...) :
>>>> RS-DBI driver: (could not run statement: MySQL server has gone away)
>>>>
>>>> If I issue a dbConnect() again, I can run queries again ... for a
>>>> little while, and then I get another "server has gone away".
>>>>
>>>> The MySQL server is on a separate machine from the client. It's
>>>> entirely possible that there's one or more firewalls in between,
>>>> which could be causing the problem. The
>>>>
>>>> I understand that MySQL has auto-reconnect functionality:
>>>>
>>>> http://blog.taragana.com/index.php/archive/how-to-enable-disable-auto-reconnect-in-mysql/
>>>>
>>>>
>>>> Does RMySQL allow me to turn on auto-reconnect? If so, how?
>>>
>>>
>>>
>>> Unfortunately it doesn't right now, but that would be a great
>>> addition. I've often had to test for the connection going away for
>>> unknown reasons as well.
>>>
>>> I'll pencil it in for the next release as it's easy to add.
>>>
>>> Jeff
>>>
>>>>
>>>> > version
>>>> _ platform
>>>> i386-redhat-linux-gnu arch i386
>>>> os linux-gnu system i386,
>>>> linux-gnu status
>>>> major 2 minor
>>>> 9.1 year 2009
>>>> month 06 day
>>>> 26 svn rev 48839
>>>> language R version.string R version
>>>> 2.9.1 (2009-06-26)
>>>> > mysqlClientLibraryVersions()
>>>> 5.0.45 5.0.45
>>>> 50045 50045
>
>
> _______________________________________________
> R-sig-DB mailing list -- R Special Interest Group
> R-sig-DB using stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-db
====================================================================================
La version française suit le texte anglais.
------------------------------------------------------------------------------------
This email may contain privileged and/or confidential information, and the Bank of
Canada does not waive any related rights. Any distribution, use, or copying of this
email or the information it contains by other than the intended recipient is
unauthorized. If you received this email in error please delete it immediately from
your system and notify the sender promptly by email that you have done so.
------------------------------------------------------------------------------------
Le présent courriel peut contenir de l'information privilégiée ou confidentielle.
La Banque du Canada ne renonce pas aux droits qui s'y rapportent. Toute diffusion,
utilisation ou copie de ce courriel ou des renseignements qu'il contient par une
personne autre que le ou les destinataires désignés est interdite. Si vous recevez
ce courriel par erreur, veuillez le supprimer immédiatement et envoyer sans délai à
l'expéditeur un message électronique pour l'aviser que vous avez éliminé de votre
ordinateur toute copie du courriel reçu.
More information about the R-sig-DB
mailing list