@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve error message for error 2006

Summary:
See discussion here:

https://secure.phabricator.com/chatlog/channel/%23phabricator/?at=21186

Basically, MySQL usually raises a good error if we exceed "max_allowed_packet":

EXCEPTION: (AphrontQueryException) #1153: Got a packet bigger than 'max_allowed_packet' bytes

But sometimes it gives us a #2006 instead. This is documented, at least:

>"With some clients, you may also get a Lost connection to MySQL server during query error if the communication packet is too large."

http://dev.mysql.com/doc/refman//5.5/en/packet-too-large.html

Try to improve the error message to point at this as a possible explanation.

Test Plan: Faked an error, had it throw, read exception message. See also chatlog.

Reviewers: btrahan, skrul

Reviewed By: skrul

CC: aran

Differential Revision: https://secure.phabricator.com/D2923

+4 -1
+4 -1
src/infrastructure/storage/connection/mysql/AphrontMySQLDatabaseConnectionBase.php
··· 217 217 218 218 switch ($errno) { 219 219 case 2013: // Connection Dropped 220 + throw new AphrontQueryConnectionLostException($exmsg); 220 221 case 2006: // Gone Away 221 - throw new AphrontQueryConnectionLostException($exmsg); 222 + $more = "This error may occur if your MySQL 'wait_timeout' ". 223 + "or 'max_allowed_packet' configuration values are set too low."; 224 + throw new AphrontQueryConnectionLostException("{$exmsg}\n\n{$more}"); 222 225 case 1213: // Deadlock 223 226 case 1205: // Lock wait timeout exceeded 224 227 throw new AphrontQueryDeadlockException($exmsg);