-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[9.x] Fix unique lock release for broadcast events #43738
Conversation
This actually brings up another issue: framework/src/Illuminate/Queue/CallQueuedHandler.php Lines 201 to 218 in 57c5672
The lock release for unique queue jobs should be moved to within the Illuminate\Bus\UniqueLock instead.
|
The UniqueBroadcastEvent has the data to release the lock after processing. Now uniqueVia is taken from the inner event or retrieved from container and working :)
I don't know how desirable it is to change the queue/jobs logic for broadcast events. Where should we draw the line? |
IMO we should not be modifying queue / job logic to accommodate this feature. Risks breaking more things. |
I've opened #43740 which explains the issue. It does not pertain to making this feature work; just fixing decoupled logic. |
Can someone explain the actual problem at its root and how this fixes it? Also, calling the foundation |
The current BroadcastEvent (job) doesn't have the queue ShouldBeUnique implementation and the required uniqueVia etc data and the unique lock is not released after processing. |
I believe this is only an issue if you don't define a |
This fix fixes not triggered lock release of #43416, #43516. It added back the UniqueBroadcastEvent class created by @DougSisk but now the uniqueId will always include the original event class.
The regular BroadcastEvent does not implement the 'Queue' ShouldBeUnique and wasn't removing the lock. Now it is possible to dispatch the same event and id after the previous has been processed.