Exception "HY000: no connection to the server" when using connection tracking in Warlock #63

Closed
opened 2020-12-16 23:49:46 +00:00 by jamie · 3 comments
jamie commented 2020-12-16 23:49:46 +00:00 (Migrated from git.hazaar.io)

Warlock is a long running process, meaning that services start up and once stuff is loaded into memory, it stays there until it is specifically deleted. When we use Hazaar\DBI\Adapter::getInstance() to get a DBI Adapter instance, that instance is tracked in memory (based on environment/config). Because this connection is now established once and then expected to always be there, if the database disappears for a bit and the connection dies, the Adaptor is in a broken.

This issue means I need to update getInstance() to check the connection state and if it's dead, kill off the existing instance and create a new one. I will need to do this as efficiently as possible so hopefully PHP-PDO has the tools to check connection states.

Warlock is a long running process, meaning that services start up and once stuff is loaded into memory, it stays there until it is specifically deleted. When we use `Hazaar\DBI\Adapter::getInstance()` to get a DBI Adapter instance, that instance is tracked in memory (based on environment/config). Because this connection is now established once and then expected to always be there, if the database disappears for a bit and the connection dies, the Adaptor is in a broken. This issue means I need to update `getInstance()` to check the connection state and if it's dead, kill off the existing instance and create a new one. I will need to do this as efficiently as possible so hopefully PHP-PDO has the tools to check connection states.
jamie commented 2020-12-17 04:11:34 +00:00 (Migrated from git.hazaar.io)

created merge request !35 to address this issue

created merge request !35 to address this issue
jamie commented 2020-12-17 04:11:34 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !35

mentioned in merge request !35
jamie commented 2020-12-17 04:13:39 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 5dd3310fb4

mentioned in commit 5dd3310fb4b813606ab72d0e1e9e41a5500ade92
jamie (Migrated from git.hazaar.io) closed this issue 2020-12-17 04:13:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/hazaar-dbi#63
No description provided.