Skip to content

[9.x] Fix unique locking on broadcast events - #43516

Merged
taylorotwell merged 7 commits into
laravel:9.xfrom
DougSisk:fix-broadcast-locking
Aug 3, 2022
Merged

[9.x] Fix unique locking on broadcast events#43516
taylorotwell merged 7 commits into
laravel:9.xfrom
DougSisk:fix-broadcast-locking

Conversation

@DougSisk

@DougSisk DougSisk commented Aug 2, 2022

Copy link
Copy Markdown

This is a fix for #43416. The lock was not being acquired because the broadcast manager was pushing straight to the queue and not using the dispatcher. Acquiring the lock within the queue method seems like the best option, as rewriting to use a dispatcher seems like it could cause a ton of headaches.

@taylorotwell

Copy link
Copy Markdown
Member

Now uniqueVia is not respected right?

@DougSisk

DougSisk commented Aug 2, 2022

Copy link
Copy Markdown
Author

I think we can eliminate the UniqueBroadcastEvent, as it's not needed since we can generate the lock key from the event. I think there's also a potential issue with having uniqueVia be a property, as I believe the cache repository can't be serialized.

@taylorotwell
taylorotwell merged commit 183d38f into laravel:9.x Aug 3, 2022
Ken-vdE pushed a commit to Ken-vdE/framework that referenced this pull request Aug 9, 2022
* Fix broadcasting locks

* Update BroadcastManager.php

* Respect event uniqueVia

* Remove UniqueBroadcastEvent, use event instead

* clean up logic

* formatting

* formatting

Co-authored-by: Taylor Otwell <taylor@laravel.com>
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.

2 participants