openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Intermittent "too many clients" error

Open SouthGoingZax opened this issue 6 years ago • 2 comments

Visiting https://openlibrary.org/works/OL14902983W/Abrasives?edition= yielded:

/openlibrary/openlibrary/templates/lists/widget.html: error in processing template: OperationalError: FATAL: sorry, too many clients already FATAL: sorry, too many clients already (falling back to default template) /openlibrary/openlibrary/templates/type/work/view.html: error in processing template: OperationalError: FATAL: sorry, too many clients already FATAL: sorry, too many clients already (falling back to default template) Unable to render this page.

Visiting it with debug=true yields: {"error": "internal_error", "message": "get_site(openlibrary.org) failed"}: image

Here's another instance of the same error (different URL) but with a stacktrace: image

Third URL: image

Is there a new connection pool limit somewhere with the move to Py3? postgress max_connections being reached somehow?

Relevant url?

I assume the specific URLs aren't relevant here but they are:

https://openlibrary.org/works/OL14902983W/Abrasives?debug=true https://openlibrary.org/books/OL25434654M/Eco-aesthetics?debug=true https://openlibrary.org/works/OL84924W/Deep_Six?debug=true

Steps to Reproduce

  1. Start visiting a lot of pages?
  • Actual: Get the error above sometimes
  • Expected: Don't get the above error

Details

  • Logged in (Y/N)? Y
  • Browser type/version? Chrome
  • Operating system? OS X
  • Environment (prod/dev/local)? prod

Proposal & Constraints

Related files

Stakeholders

@mekarpeles @cdrini @cclauss

SouthGoingZax avatar Dec 03 '20 05:12 SouthGoingZax

Please test this hypothesis... Reloading multiple times will get some success and some failure.

cclauss avatar Dec 03 '20 05:12 cclauss

I did test this by reloading several page many times before reporting the issue, and in every case, I was able to repeat it in less than 10 reloads.

Response from @mekarpeles on Slack: "ol-web[3,4] were still alive (meaning they likely had close to 100 dormant db connections or were polluting cache)".

I haven't been able to reproduce this since then, so I'll close this.

SouthGoingZax avatar Dec 03 '20 15:12 SouthGoingZax