Timeouts during connect can crash connection. #269

Closed
mworrell opened this Issue Nov 28, 2011 · 3 comments

2 participants

@mworrell
Zotonic member

On busy servers we see sometimes the following errors:

webmachine error: path="/comet"
{error,{badmatch,{error,timeout}},
       [{z_db,get_connection,1},
        {z_db,q,3},
        {mod_foobar_acl,logon,2},
        {z_notifier,first1,3},
        {z_acl,logon,2},
        {z_context,ensure_session,1},
        {z_context,ensure_all,1},
        {resource_comet,forbidden,2}]}

=ERROR REPORT==== 17-Nov-2011::16:08:43 ===
** State machine <0.27078.67> terminating 
** Last message in was {'EXIT',<0.136.0>,
                        {timeout,
                         {gen_fsm,sync_send_event,
                          [<0.30330.67>,
                           {connect,"127.0.0.1","foobar","-----",
                            [{database,"foobar"},
                             {host,"127.0.0.1"},
                             {password,"-----"},
                             {port,5432},
                             {password,[]},
                             {schema,"public"},
                             {username,"foobar"},
                             {database,"zotonic"},
                             {schema,"public"}]}]}}}
** When State == querying
**      Data  == {state,undefined,<0.27079.67>,#Port<0.12972549>,
                        [{<<"client_encoding">>,<<"UTF8">>},
                         {<<"DateStyle">>,<<"ISO, MDY">>},
                         {<<"integer_datetimes">>,<<"on">>},
                         {<<"IntervalStyle">>,<<"postgres">>},
                         {<<"is_superuser">>,<<"off">>},
                         {<<"server_encoding">>,<<"UTF8">>},
                         {<<"server_version">>,<<"8.4.2">>},
                         {<<"session_authorization">>,<<"foobar">>},
                         {<<"standard_conforming_strings">>,<<"off">>},
                         {<<"TimeZone">>,<<"Europe/Amsterdam">>}],
                        true,"foobar",undefined,
                        {<0.147.0>,#Ref<0.0.243.198674>},
                        {12758,512192653},
                        {statement,[],
                                   [{column,<<"id">>,int4,4,-1,1},
                                    {column,<<"module">>,varchar,-1,34,1},
                                    {column,<<"function">>,varchar,-1,34,1},
                                    {column,<<"key">>,varchar,-1,104,1},
                                    {column,<<"props">>,bytea,-1,-1,1}],
                                   []},
                        73}
** Reason for termination = 
** {timeout,{gen_fsm,sync_send_event,
                     [<0.30330.67>,
                      {connect,"127.0.0.1","foobar","-----",
                               [{database,"foobar"},
                                {host,"127.0.0.1"},
                                {password,"-----"},
                                {port,5432},
                                {password,[]},
                                {schema,"public"},
                                {username,"foobar"},
                                {database,"zotonic"},
                                {schema,"public"}]}]}}

=ERROR REPORT==== 17-Nov-2011::16:08:44 ===
** State machine <0.30330.67> terminating 
** Last message in was {'EXIT',<0.136.0>,
                        {timeout,
                         {gen_fsm,sync_send_event,
                          [<0.30330.67>,
                           {connect,"127.0.0.1","foobar","-----",
                            [{database,"foobar"},
                             {host,"127.0.0.1"},
                             {password,"-----"},
                             {port,5432},
                             {password,[]},
                             {schema,"public"},
                             {username,"foobar"},
...

This can crash the whole database pool for the site. It should only crash the to-be-opened connection.
This is an issue in the pgsql driver we use.

@mworrell mworrell was assigned Nov 28, 2011
@mworrell mworrell added a commit that referenced this issue Nov 30, 2011
@mworrell mworrell Stabilizing the database connection pool and sites in the presence of…
… database connection failures.

Refers to issue #269
3277b5e
@arjan
Zotonic member

@mworrell can we consider this one fixed?

@mworrell
Zotonic member

didn't see it happening again.

we have the startup issue (with the too many connections) filed?
if so then this one can close

@arjan
Zotonic member

Yes we have, #336. Closing..

@arjan arjan closed this Sep 12, 2012
@rpip rpip pushed a commit to rpip/zotonic that referenced this issue Aug 12, 2013
@mworrell mworrell Stabilizing the database connection pool and sites in the presence of…
… database connection failures.

Refers to issue #269
8d2265d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment