Closed
Description
Description
The existing PDO lock store requires expiration to prevent stalled locks following unexpected termination. The Postgres store offers this feature, but there is not a MySQL equivalent.
Are the locking functions in mysql a viable solution? I see a problem with certain binlog_format
settings. There shouldn't be an issue if the locks are assumed against the master.
Is this possible?
Example
Before
$store = new PdoStore(...);
$factory = ...
$lock = $factory->getLock('foo', 300.0);
$bar = 'baz';
while (true) {
$bar .= $bar.$bar;
$lock->refresh();
}
// stalled out for 300s
After
$store = new MySqlStore(...);
$factory = ...
$lock = $factory->getLock('foo');
$bar = 'baz';
while (true) {
$bar .= $bar.$bar;
$lock->refresh();
}
// lock released when mysql connection dies