Open dfelton opened 4 years ago
If too much time passes between fill events the database server will hangup on the PDO object. This is the same issue as what is happening in #31.
Exception: PDOException Code: HY000 Message: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away Strace: #0 vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Connection.php(306): PDO->beginTransaction() #1 src/TradeRepeater/Model/Resource/Trade/Action/BuyPlaced.php(29): Zend\Db\Adapter\Driver\Pdo\Connection->beginTransaction() #2 src/Command/Command/TradeRepeater/FillMonitor/WebSocket.php(138): Kobens\Gemini\TradeRepeater\Model\Resource\Trade\Action\BuyPlaced->setNextState(2219) #3 src/Command/Command/TradeRepeater/FillMonitor/WebSocket.php(101): Kobens\Gemini\Command\Command\TradeRepeater\FillMonitor\WebSocket->processMessage(Array, Object(Symfony\Component\Console\Output\ConsoleOutput)) #4 [internal function]: Kobens\Gemini\Command\Command\TradeRepeater\FillMonitor\WebSocket->Kobens\Gemini\Command\Command\TradeRepeater\FillMonitor\{closure}('a', NULL) #5 vendor/amphp/amp/lib/Coroutine.php(105): Generator->send('[{"type":"fill"...') #6 vendor/amphp/amp/lib/Internal/Placeholder.php(130): Amp\Coroutine->Amp\{closure}(NULL, '[{"type":"fill"...') #7 vendor/amphp/amp/lib/Coroutine.php(110): Amp\Coroutine->resolve('[{"type":"fill"...') #8 vendor/amphp/amp/lib/Internal/Placeholder.php(130): Amp\Coroutine->Amp\{closure}(NULL, NULL) #9 vendor/amphp/amp/lib/Deferred.php(45): class@anonymous->resolve(NULL) #10 vendor/amphp/byte-stream/lib/IteratorStream.php(57): Amp\Deferred->resolve() #11 vendor/amphp/amp/lib/Success.php(36): Amp\ByteStream\IteratorStream->Amp\ByteStream\{closure}(NULL, false) #12 vendor/amphp/amp/lib/Internal/Placeholder.php(125): Amp\Success->onResolve(Object(Closure)) #13 vendor/amphp/amp/lib/Deferred.php(45): class@anonymous->resolve(Object(Amp\Success)) #14 vendor/amphp/amp/lib/Internal/Producer.php(185): Amp\Deferred->resolve(Object(Amp\Success)) #15 vendor/amphp/amp/lib/Emitter.php(57): class@anonymous->complete() #16 vendor/amphp/websocket/src/Rfc6455Client.php(348): Amp\Emitter->complete() #17 vendor/amphp/websocket/src/Rfc6455Client.php(935): Amp\Websocket\Rfc6455Client->onData(1, '[{"type":"fill"...', true) #18 [internal function]: Amp\Websocket\Rfc6455Client->parser() #19 vendor/amphp/websocket/src/Rfc6455Client.php(269): Generator->send('\x81~\x02L[{"type":"f...') #20 [internal function]: Amp\Websocket\Rfc6455Client->read() #21 vendor/amphp/amp/lib/Coroutine.php(105): Generator->send('\x81~\x02L[{"type":"f...') #22 vendor/amphp/amp/lib/Internal/Placeholder.php(130): Amp\Coroutine->Amp\{closure}(NULL, '\x81~\x02L[{"type":"f...') #23 vendor/amphp/amp/lib/Deferred.php(45): class@anonymous->resolve('\x81~\x02L[{"type":"f...') #24 vendor/amphp/byte-stream/lib/ResourceInputStream.php(101): Amp\Deferred->resolve('\x81~\x02L[{"type":"f...') #25 vendor/amphp/amp/lib/Loop/NativeDriver.php(192): Amp\ByteStream\ResourceInputStream::Amp\ByteStream\{closure}('n', Resource id #416, NULL) #26 vendor/amphp/amp/lib/Loop/NativeDriver.php(97): Amp\Loop\NativeDriver->selectStreams(Array, Array, 0.297) #27 vendor/amphp/amp/lib/Loop/Driver.php(134): Amp\Loop\NativeDriver->dispatch(true) #28 vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick() #29 vendor/amphp/amp/lib/Loop.php(84): Amp\Loop\Driver->run() #30 src/Command/Command/TradeRepeater/FillMonitor/WebSocket.php(74): Amp\Loop::run(Object(Closure)) #31 vendor/symfony/console/Command/Command.php(255): Kobens\Gemini\Command\Command\TradeRepeater\FillMonitor\WebSocket->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #32 vendor/symfony/console/Application.php(1012): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #33 vendor/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(Kobens\Gemini\Command\Command\TradeRepeater\FillMonitor\WebSocket), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #34 vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #35 bin/gemini(283): Symfony\Component\Console\Application->run() #36 {main}
Manual workaround available: bump up the wait_timeout
If too much time passes between fill events the database server will hangup on the PDO object. This is the same issue as what is happening in #31.