Skip to content

Navigation Menu

Sign in
Appearance settings

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] Add MysqlStore that use GET_LOCK #25578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
[Lock] Use distinct store for forked processes
  • Loading branch information
GromNaN committed Dec 28, 2017
commit 2b1a0e55dcf92130088913172e6ca111d6bc61c2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ trait BlockingStoreTestTrait
{
/**
* @see AbstractStoreTest::getStore()
*
* @return StoreInterface
*/
abstract protected function getStore();

Expand All @@ -38,8 +40,6 @@ public function testBlockingLocks()
// Amount a microsecond used to order async actions
$clockDelay = 50000;

/** @var StoreInterface $store */
$store = $this->getStore();
$key = new Key(uniqid(__METHOD__, true));
$parentPID = posix_getpid();

Expand All @@ -50,6 +50,7 @@ public function testBlockingLocks()
// Wait the start of the child
pcntl_sigwaitinfo(array(SIGHUP), $info);

$store = $this->getStore();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

try {
// This call should failed given the lock should already by acquired by the child
$store->save($key);
Expand All @@ -71,6 +72,8 @@ public function testBlockingLocks()
} else {
// Block SIGHUP signal
pcntl_sigprocmask(SIG_BLOCK, array(SIGHUP));

$store = $this->getStore();
try {
$store->save($key);
// send the ready signal to the parent
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.