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

feat: implement local contexts #541

Merged
merged 2 commits into from
May 9, 2024

Conversation

d4rky-pl
Copy link
Contributor

@d4rky-pl d4rky-pl commented May 4, 2024

Fixes #247, this is my attempt at the local context problem. Please let me know if there are any further tests you'd like me to add to check if this implementation is solid enough to handle all the possible use cases (thread safety?)

@d4rky-pl
Copy link
Contributor Author

d4rky-pl commented May 6, 2024

I was trying to implement a thread safety specs but realized it doesn't make sense:

  • For default Honeybadger agent instance or one created by Honeybadger::Agent the context manager is already implemented as a thread variable (Thread.current) so the state here is not shared between the threads
  • For Honeybadger::Agent created with local_context: true the context manager is already not thread safe as every thread sharing the agent can modify the context of the other threads

Please let me know if there's anything I can do to fast track releasing this feature. This would help a lot in being able to use tags efficiently without resorting to either manually clearing them or manually handling exceptions within a block.

@subzero10 subzero10 changed the title feat: Implement local contexts feat: implement local contexts May 8, 2024
@d4rky-pl d4rky-pl force-pushed the 247-local-context branch from 5ad7a3e to 4dd4459 Compare May 8, 2024 19:18
@subzero10 subzero10 merged commit 806718e into honeybadger-io:master May 9, 2024
41 checks passed
@d4rky-pl d4rky-pl deleted the 247-local-context branch May 9, 2024 10:46
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.

Local/Nested Context
3 participants