Turnip api server suffering from FD leaks

Bug #1683546 reported by Thomas Cuthbert
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
turnip
Fix Released
High
Thiago F. Pappacena

Bug Description

We received pages that the git api service was returning http error 500s.

Upon closer inspection of the API logs we found the following:
https://pastebin.canonical.com/186035/

It looks like the gunicorn server is leaking FD and the system is unable to open a handle to necessary files.

Restarting the api server clears the issue.

Related branches

Revision history for this message
Colin Watson (cjwatson) wrote :

In the past we've guessed that a libgit2 upgrade should help. I've been working on that today.

Changed in turnip:
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Colin Watson (cjwatson) wrote :

I'm obviously not working on this right now ... although I think a libgit2 upgrade is still worthwhile and the next thing to try.

Changed in turnip:
assignee: Colin Watson (cjwatson) → nobody
status: In Progress → Triaged
Changed in turnip:
assignee: nobody → Thiago F. Pappacena (pappacena)
status: Triaged → In Progress
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

It is hard to confirm that what I've found is actually the cause of this problem, but looking at the traceback and my tests to port turnip to python3, maybe the cause of this bug could be simpler than we thought.

It seems that we are not explicitly closing the config file descriptor, and it seems that we read this configuration on every request. So *maybe* we could have too many open config FDs if we have several API calls and the GC isn't running frequently enough.

I'm sending a quick MP to check if closing the FD will make this problem go away; maybe we could cache the configuration too, to avoid reading it on every single request.

Changed in turnip:
status: In Progress → Fix Committed
Colin Watson (cjwatson)
Changed in turnip:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.