zotonic fails after postgresql restart #55

Closed
arjan opened this Issue Sep 5, 2011 · 4 comments

Projects

None yet

1 participant

@arjan
Zotonic member

From http://code.google.com/p/zotonic/issues/detail?id=49

To reproduce -- restart PostgreSQL ("/etc/init.d/postgresql-8.4 restart"
should be enough).

When PostgreSQL is back, it is still impossible to get connection to DB pool:

{error,
{error,
{badmatch,{error,timeout}},
[{z_db,get_connection,1},
{z_db,q,3},
{z_search,search_result,3},
{z_search,search_pager,4},
{m_search,search_pager,2},
{m_search,m_find_value,3},

{template_mysite__home_user_sites_zotonic_priv_sites_mysite_templates_home_tpl,
render2,2},

{template_mysite__home_user_sites_zotonic_priv_sites_mysite_templates_home_tpl,
render,2}]}}

Tested on version 0.3.

@arjan
Zotonic member

Well, I've made a quick hack, which resolves a problem.

Commented on Google Code by *igor%gor...@gtempaccount.com***

@arjan
Zotonic member

Hi Igor,

Your patch looks good, and I understand your solution.
One issue though. I think it is good when we crash when wrong credentials are supplied.
We propose to only ignore the error on a {error, timeout} and otherwise crash.

Do you agree?

  • Marc

Commented on Google Code by *profile.url***

@arjan
Zotonic member

Hi, Marc.

If you replace _Reason to econnrefused, you will get the behaviour described above.

Still there is another issue: zotonic application will not be started if postgresql
server is downed. I'm not sure whether it is correct or not. As for me, I prefer to
make erlang applications fully start even if auxiliary services (DB, AMQP, XMPP) are
not available at start-up.

Thanks!

Commented on Google Code by *igor%gor...@gtempaccount.com***

@arjan
Zotonic member

Fixed since revision bdc1683a9caf. I implemented this for the 'econnrefused' case
only, on Marc's suggestion.
Thanks Igor!

Commented on Google Code by *scherpenisse***

@arjan arjan closed this Sep 5, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment