Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Lock] MySQL non-expiring locking using GET_LOCK #45251

Copy link
Copy link
Closed
@rtek

Description

@rtek
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.