This may be related to T11748 / D16714. We have a task for a large revision ("This diff is very large and affects 4,800 files") which is still appearing to try to generate mail which is too large, and fails to insert into MySQL. Unlike T11748, it fails quickly, and doesn't consume much CPU.
[19-Dec-2016 22:39:11 UTC] [2016-12-19 22:39:11] EXCEPTION: (PhutilProxyException) Error while executing Task ID 35362582. {>} (AphrontConnectionLostQueryException) #2006: MySQL server has gone away This error may occur if your MySQL 'wait_timeout' or 'max_allowed_packet' configuration values are set too low. at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:304] [19-Dec-2016 22:39:11 UTC] arcanist(head=master, ref.master=2484647734ee), phabricator(head=master, ref.master=b6d9c7deea60), phutil(head=master, ref.master=f1afeab618fa), pytest-phabricator(head=1550854ff89dca474176d307f6a485cd5eff0452, ref.master=1939f1e4f656) [19-Dec-2016 22:39:11 UTC] #0 <#2> AphrontBaseMySQLDatabaseConnection::throwCommonException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:348] [19-Dec-2016 22:39:11 UTC] #1 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:289] [19-Dec-2016 22:39:11 UTC] #2 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:185] [19-Dec-2016 22:39:11 UTC] #3 <#2> AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:8] [19-Dec-2016 22:39:11 UTC] #4 <#2> queryfx(AphrontMySQLiDatabaseConnection, string, string, string, array, string) [19-Dec-2016 22:39:11 UTC] #5 <#2> call_user_func_array(string, array) called at [<phutil>/src/aphront/storage/connection/AphrontDatabaseConnection.php:58] [19-Dec-2016 22:39:11 UTC] #6 <#2> AphrontDatabaseConnection::query(string, string, string, array, string) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1261] [19-Dec-2016 22:39:11 UTC] #7 <#2> LiskDAO::insertRecordIntoDatabase(string) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1106] [19-Dec-2016 22:39:11 UTC] #8 <#2> LiskDAO::insert() called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1075] [19-Dec-2016 22:39:11 UTC] #9 <#2> LiskDAO::save() called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:355] [19-Dec-2016 22:39:11 UTC] #10 <#2> PhabricatorMetaMTAMail::save() called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1178] [19-Dec-2016 22:39:11 UTC] #11 <#2> PhabricatorApplicationTransactionEditor::publishTransactions(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php:21] [19-Dec-2016 22:39:11 UTC] #12 <#2> PhabricatorApplicationTransactionPublishWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:123] [19-Dec-2016 22:39:11 UTC] #13 <#2> PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:171] [19-Dec-2016 22:39:11 UTC] #14 <#2> PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:22] [19-Dec-2016 22:39:11 UTC] #15 PhabricatorTaskmasterDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:181] [19-Dec-2016 22:39:11 UTC] #16 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:127]
Task details:
+----------+------------------------------------------------+----------------------------+--------------+--------------+----------+-------------+----------+--------------------------------+ | id | taskClass | leaseOwner | leaseExpires | failureCount | dataID | failureTime | priority | objectPHID | +----------+------------------------------------------------+----------------------------+--------------+--------------+----------+-------------+----------+--------------------------------+ | 35362582 | PhabricatorApplicationTransactionPublishWorker | 12760:1482187718:tails:648 | 1482188018 | 3 | 35362630 | 1482187754 | 1000 | PHID-DREV-wf7fxuctedq3wqaown4u | +----------+------------------------------------------------+----------------------------+--------------+--------------+----------+-------------+----------+--------------------------------+
mysql> select @@max_allowed_packet; +----------------------+ | @@max_allowed_packet | +----------------------+ | 67108864 | +----------------------+ 1 row in set (0.00 sec)