Skip to content

Conversation

@tagliala
Copy link
Contributor

Previously, if the block passed to with_asset_finder raised an exception, the thread-local variable :inline_svg_asset_finder was not cleared, leading to potential leakage across threads.

This change ensures that the variable is always cleared using an ensure block, even if an error occurs.

Close #184

@tagliala tagliala force-pushed the bugfix/184-prevent-thread-leak-on-error branch from 307baa2 to 124ffdd Compare March 31, 2025 14:56
@tagliala tagliala marked this pull request as ready for review March 31, 2025 14:56
Previously, if the block passed to `with_asset_finder` raised an
exception, the thread-local variable `:inline_svg_asset_finder` was
not cleared, leading to potential leakage across threads.

This change ensures that the variable is always cleared using an
`ensure` block, even if an error occurs.

Close jamesmartin#184
@tagliala tagliala force-pushed the bugfix/184-prevent-thread-leak-on-error branch from 124ffdd to 1f9b6c8 Compare March 31, 2025 15:00
@tagliala
Copy link
Contributor Author

Hi @jamesmartin, I've find this issue in production code when preparing #183

I would merge this before and then go for the other one

@tagliala tagliala mentioned this pull request Mar 31, 2025
1 task
@jamesmartin jamesmartin merged commit 28264c5 into jamesmartin:master Apr 24, 2025
7 checks passed
@jamesmartin
Copy link
Owner

Thanks, @tagliala. ✨

@tagliala tagliala deleted the bugfix/184-prevent-thread-leak-on-error branch April 24, 2025 07:52
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.

Random spec failure with seed 42969

2 participants