# Waiting for 1 connection to finish

**URL:** <https://discuss.rubyonrails.org/t/waiting-for-1-connection-to-finish/44440>\
**Category:** rubyonrails-talk\
**Created:** [July 21, 2009, 2:27pm UTC](https://discuss.rubyonrails.org/t/waiting-for-1-connection-to-finish/44440 "2009-07-21T14:27:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [July 21, 2009, 2:27pm UTC](https://discuss.rubyonrails.org/t/waiting-for-1-connection-to-finish/44440/1 "2009-07-21T14:27:19Z")

</div>

For a few days now since a major update on my rails app on the production server, I am getting the following error message when restarting the application:

> > Waiting for 1 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now

I am using Rails 2.3.3, Thin 1.2.2 and pg 0.8.0 (postgresql gem).

Has anyone encountered such problem? I'm in deep trouble.

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [July 21, 2009, 2:35pm UTC](https://discuss.rubyonrails.org/t/waiting-for-1-connection-to-finish/44440/2 "2009-07-21T14:35:16Z")

</div>

Damn it was a former zombie Thin process that was still causing trouble!

With kill -9 and restarting all new Thin instances to take advantage of the updated gem seems to have resolved the problem. I'll still keep an eye on it, and provide feedback.

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [July 22, 2009, 9:04am UTC](https://discuss.rubyonrails.org/t/waiting-for-1-connection-to-finish/44440/3 "2009-07-22T09:04:51Z")

</div>

This morning all my Thin process are stuck again :-(, something seems to happen during the night or at least during a long period of time so that all processes end up blocked.

---

<div class="post-metadata">

**Author:** ![Con](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@Con](https://discuss.rubyonrails.org/u/Con)\
**Post date:** [July 22, 2009, 9:21am UTC](https://discuss.rubyonrails.org/t/waiting-for-1-connection-to-finish/44440/4 "2009-07-22T09:21:41Z")

</div>

> This morning all my Thin process are stuck again :-(, something seems to
> 
> happen during the night or at least during a long period of time so that
> 
> all processes end up blocked.

Have you done any sand-box (i.e. staging server) testing prior to migrating your production application

from 2.3.2 to 2.3.3?

-Conrad

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [July 22, 2009, 9:55am UTC](https://discuss.rubyonrails.org/t/waiting-for-1-connection-to-finish/44440/5 "2009-07-22T09:55:09Z")

</div>

Cool my processes are blocking and here is what $ netstat -anp is giving me:

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name [...] tcp 1239 0 10.0.0.2:3100 10.0.0.1:36186 CLOSE\_WAIT - tcp 1 0 10.0.0.2:3100 10.0.0.1:48261 CLOSE\_WAIT - tcp 1107 0 10.0.0.2:3100 10.0.0.1:48286 CLOSE\_WAIT - tcp 1239 0 10.0.0.2:3100 10.0.0.1:36192 CLOSE\_WAIT - tcp 1152 0 10.0.0.2:3100 10.0.0.1:36189 CLOSE\_WAIT - tcp 1152 0 10.0.0.2:3100 10.0.0.1:36195 CLOSE\_WAIT [...]

Here is my setup, which I admit might be a bit overkill:

10.0.0.1 is a Virtual Machine that runs Nginx which proxy\_passes requests to 10.0.0.2 which is another Virtual Machine where my Rails app is running. For some reason connection between these two is crapping out on me. Any idea why that would happen?
