Skip to content

Conversation

@hugochinchilla
Copy link
Contributor

We are seeing breadcrumbs from previous requests on our traces in Sentry, this makes it less useful for debugging and also causes the memory usage to increase between requests.

@Baldinof
Copy link
Owner

Hi, thank you for using this bundle :)

The listener you modified is called only on worker stop (process exit) and not on every request.

A good place to fix this is in the middleware, where a configureScope() is already called: https://github.com/Baldinof/roadrunner-bundle/blob/master/src/Http/Middleware/SentryMiddleware.php#L65

@Baldinof
Copy link
Owner

Also, I see that Scope has a clear() method, maybe it's a good idea to call this to clear all contextual data on the new request?

@hugochinchilla
Copy link
Contributor Author

@Baldinof you are right, i have changed the code to use this method instead.

@Baldinof
Copy link
Owner

I don't see the new diff, did you pushed it?

@hugochinchilla
Copy link
Contributor Author

Sorry, it's pushed now

@Baldinof
Copy link
Owner

👍

Can you call clear() in the SentryMiddlware instead of on the WorkerStopEvent?

@hugochinchilla
Copy link
Contributor Author

I moved the code to the middleware and added a test case.

@Baldinof
Copy link
Owner

Perfect!

Can you run composer cs:fix to fix the failing CI job?

@hugochinchilla
Copy link
Contributor Author

Done!

@Baldinof Baldinof merged commit 7d77ef8 into Baldinof:master Sep 18, 2020
@Baldinof
Copy link
Owner

Thank you :)

@Baldinof
Copy link
Owner

I released 1.3.2 with your fix.

@hugochinchilla
Copy link
Contributor Author

Thank you very much!!

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