This project is archived and is in readonly mode.

#6193 ✓stale
timuckun

AR loses connection with postgres and does not recover.

Reported by timuckun | December 19th, 2010 @ 10:49 AM

I have lots of daemons and inevitably after a couple of days of running one or more of them will lose connection to the database. Not all of them. Just some of them and it's always a random one. I have attached the errors to the bottom. These daemons run on different servers so it's not always the same server that has this problem. Stopping and restarting the daemon fixes the problem. Postgres logs show nothing while the error is happening.

I asked the postgres list and they said it might be thread related. I used to have ActiveRecord::Base.connection_pool.clear_stale_cached_connections! in my daemons so I took that out hoping it would solve the problem and it hasn't.

2010-12-19 10:19:38 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:38 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:39 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:39 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:40 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:41 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:41 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:41 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:42 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:42 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:43 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:43 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:44 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:44 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:45 digg_story_worker.rb ERROR PGError: lost synchronization with server: got message type "o", length 544501536
2010-12-19 10:19:45 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:46 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:47 url_expire_worker.rb ERROR PGError: lost synchronization with server: got message type "�", length -65536
2010-12-19 10:19:51 digg_story_worker.rb ERROR PGError: lost synchronization with server: got message type "o", length 544501536
2010-12-19 10:19:57 digg_story_worker.rb ERROR PGError: lost synchronization with server: got message type "o", length 544501536
2010-12-19 10:20:03 digg_story_worker.rb ERROR PGError: lost synchronization with server: got message type "o", length 544501536
2010-12-19 10:20:09 digg_story_worker.rb ERROR PGError: lost synchronization with server: got message type "o", length 544501536
2010-12-19 10:20:15 digg_story_worker.rb ERROR PGError: lost synchronization with server: got message type "o", length 544501536
2010-12-19 10:20:21 digg_story_worker.rb ERROR PGError: lost synchronization with server: got message type "o", length 544501536

Comments and changes to this ticket

  • rails

    rails March 20th, 2011 @ 12:00 AM

    • Tag changed from activerecord rails3, postgresql, rails3.0.3 to activerecord rails3, postgresql, rails303
    • State changed from “new” to “open”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • rails

    rails March 20th, 2011 @ 12:00 AM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages