-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postgres connection leak (maybe sqlite3 too?) #387
Comments
The query output formatting seems to be messed up, can you upload it somewhere? (e.g. hastebin.com) I would like to see more connections and what state they are in. |
I run maddy 0.5.0 with PostgreSQL 13.4 and I do not have the same issue. The only difference seems to be you using S3 storage. Could you also try killing the maddy process with SIGTRAP ( |
postgres connections: https://hastebin.com/awesebuday.rb There was no output from running I'll try without s3 as well to see if that helps. It could make sense as received messages don't seem to get stored anywhere. So maybe it's related. |
It should be in maddy log (wherever it is, probably systemd journal). |
I can confirm that switching to the fs module made both of these issues go away. Here's the output of the TRAP: https://pastebin.com/v01dy38X (thanks for the tip on where to find it) |
The issue turns out to be that my s3 connection settings were wrong (i'm actually using linode and their docs were a bit confusing). Now that the connection is working properly both issues have been resolved. |
Thanks for helping me troubleshoot the issue! |
Describe the bug
After running maddy with the postgres module for 15 minutes, the number of connections to postgres has climbed to 13 open connections. I first observed this after running it over night and finding there were no more available connection in the morning. By the time i finished writing this report, the number of connections had grown to 22.
The query that is causing the issue is
UPDATE mboxes SET uidnext = uidnext + $1, msgsCount = msgsCount + $2, WHERE id = $3 RETURNING uidnext - 1
I originally switched to using postgres because I was having issues with sqlite3. Incoming mail was failing with reason: "the database is locked". I'd be curious to know if that was being caused by the same issue but am unfamiliar with sqlite3.
Steps to reproduce
Run maddy with the postgres module and watch the connections climb. (replace
maddy
with your database name in the following query).Log files
truncated output from sql query
(it goes on)
Configuration file
maddy.conf
Environment information
The text was updated successfully, but these errors were encountered: