Skip to content
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

[5.8] Make the redis queue blocking pop atomic (alternative PR) #27336

Merged
merged 8 commits into from
Feb 12, 2019

Conversation

halaei
Copy link
Contributor

@halaei halaei commented Jan 28, 2019

This is an alternative to #27227. The main difference is in the way these PRs handle some edge cases especially when mixing blocking & non-blocking workers/pushers.
In #27227 non-blocking operations do not interact with notify queue and a script is run to resize the notify queue on every blocking pop.
In this PR non-blocking pushers/workers push/pop from notify queue as well.

@halaei
Copy link
Contributor Author

halaei commented Jan 28, 2019

@yuloh One retry added if blpop was successful 15d19e7

@halaei
Copy link
Contributor Author

halaei commented Jan 28, 2019

@yuloh sorry check 67883ff

@halaei
Copy link
Contributor Author

halaei commented Jan 28, 2019

It is a bit hard to add a test to prevent a bug like the one in 15d19e7
I think I had one test for that in my former PRs...

@taylorotwell
Copy link
Member

taylorotwell commented Jan 30, 2019

So, which PR do you two think is better? 😆

public function testBlockingPop($driver)
{
$this->tearDownRedis();
if ($pid = pcntl_fork() > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the pcntl extension is required. You might need to check if it's installed and skip the test if it's not.

@matt-allan
Copy link
Contributor

This PR will perform better while solving most of the issues discussed in #27227. I will close mine.

* @param string $from
* @param string $to
* @param string $from
* @param string $to

Choose a reason for hiding this comment

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

Just a PHPDoc nit: see https://laravel.com/docs/5.7/contributions#coding-style, should have 2 spaces in between.

There's a few spots as well.

@taylorotwell
Copy link
Member

Would need full upgrade guide / breaking change summary like other PR.

@halaei
Copy link
Contributor Author

halaei commented Feb 8, 2019

@taylorotwell I can't think of a change with a high chance of impact. But I sent a PR to docs: laravel/docs#4965

@taylorotwell taylorotwell merged commit 0acaf33 into laravel:master Feb 12, 2019
@taylorotwell
Copy link
Member

Thanks for your help @yuloh and @halaei

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants