Skip to content

Conversation

@LucaGallinari
Copy link
Member

As stated in the section "Long running processes and avoiding memory leaks" here:

Calling $logger->reset(); means flushing/cleaning all buffers, resetting internal state, and getting it back to a state in which it can receive log records again.

This is the conceptual equivalent of ending a web request, and can be done between every background job you process, or whenever appropriate. It reduces memory usage and also helps keep logs focused on the task at hand, avoiding log leaks between different jobs.

We should call $logger->reset(); in all appropriate points of ProducerInstance and WorkerInstance, in order to "properly execute" buffered monolog handler. This is especially important when using a "DeduplicationHandler": with the actual implementation it doesn't not send emails immediatly (even tho it should) until the ESB is stopped.

I am not really experienced on the ESB internal, so i don't know if they points that i modified are ok, or there are ones in which we can call the "reset".

@mmenozzi
Copy link
Member

@LucaGallinari could you please rebase this on top of master?

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.

3 participants