Dovecot and MySQL aborted connections.

Benjamin Connelly ben at electricembers.coop
Wed Oct 30 20:27:29 EET 2019


We also spotted these sql connections getting aborted, upon upgrading 
MySQL from 5.6 to 5.7. (Going back to 5.6 we don't see them!)

Turning on mysql general query logging we can see it is Dovecot's mysql 
connections that inquire about or update quota usage in particular:


*** /logs//mysql.log ***
2019-10-30T10:52:22.624690-07:00	    2 Connect	dovecot at localhost on 
npomail using Socket

2019-10-30T10:52:40.019780-07:00	    2 Query	SELECT bytes FROM quota2 
WHERE username = 'a at bla'
2019-10-30T10:52:40.020948-07:00	    2 Query	SELECT messages FROM quota2 
WHERE username = 'a at bla'

2019-10-30T10:53:40.113374-07:00 2 [Note] Aborted connection 2 to db: 
'npomail' user: 'dovecot' host: 'localhost' (Got an error reading 
communication packets)


Increasing mysqld's net_read_timeout and net_write_timeout values to 
3600 does not stop the aborted connections.

It seems asymptomatic. If the connection to mysql is still there to do 
quota operations, Dovecot seems to use it. If it's been aborted by the 
server, Dovecot seems to just (re)connect. . . But I'd love to help find 
the root or file a bug report or learn what it is we've configured 
wrong. . .

  Benjamin


More information about the dovecot mailing list