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

Fix events generated in queue worker not sending #228

Merged
merged 7 commits into from
Apr 23, 2019

Conversation

stayallive
Copy link
Collaborator

@stayallive stayallive commented Apr 11, 2019

This is a workaround until we are able to restructure / fix the underlying issue in the client and our inability to wait for all events to be sent (or make sure they are sent immediately instead of waiting for a wait call, context getsentry/sentry-php#799).

The scope popping was also not happening correctly because the JobProcessed event is only fired when a job is successfully handled. Another event is dispatched when an error occurs but the exception is logged after those events fire, thus the scope will already be popped once the exception is recorded, making the scope effectively useless.

/fixes #222

Copy link
Member

@HazAT HazAT left a comment

Choose a reason for hiding this comment

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

Thx 💯 LGTM

{
$client = Hub::getCurrent()->getClient();

if ($client instanceof Client) {
Copy link
Member

Choose a reason for hiding this comment

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

We should implement close/flush in the main SDK, this should make this obsolete.
This code should go directly in there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@HazAT yes, we had extensive discussion about it and the consensus is we made a mistake implementing the async stuff, so this is a workaround until we can fix that in the base SDK 👍 this will be removed at a later time since it won't be needed if fixed in the base SDK.

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

Successfully merging this pull request may close these issues.

Errors from queued jobs aren't sent until the queue runner is restarted
2 participants