Skip to content

Conversation

@bdurand
Copy link
Owner

@bdurand bdurand commented Jan 4, 2026

Changed

  • Replaced thread local variables with fiber local variables to prevent behavior from leaking across fibers.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves fiber state management by replacing thread-local variables with fiber-local variables to prevent behavior from leaking across fibers when caching is disabled within a block. Additionally, it adds support for setting the cache to an in-memory cache using true as a shorthand.

Key changes:

  • Introduced a new FiberLocals class to manage fiber-scoped variables with proper isolation
  • Refactored cache disable/enable mechanisms to use fiber locals instead of thread locals
  • Added support for support_table_cache = true as an alias for :memory cache

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
lib/support_table_cache/fiber_locals.rb New utility class implementing fiber-local variable storage with mutex-based synchronization
lib/support_table_cache.rb Refactored to use FiberLocals instead of Thread.current.thread_variable_*, added support for true value in cache assignment, updated testing! and cache checking logic
spec/support_table_cache/fiber_locals_spec.rb Comprehensive test suite for FiberLocals covering fiber isolation, thread safety, nested blocks, and memory cleanup
spec/support_table_cache_spec.rb Added test case for setting cache to memory cache using true
CHANGELOG.md Added version 1.1.5 release notes documenting the fiber locals change and true cache assignment feature
VERSION Bumped version from 1.1.4 to 1.1.5
README.md Added table of contents and reorganized companion gems section with tip callout
AGENTS.md New file with detailed Copilot instructions for the project
Rakefile Removed YARD, appraisal, and standard rake tasks
.github/workflows/continuous_integration.yml Updated commands for standardrb and yard to run directly instead of via rake

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

bdurand and others added 3 commits January 5, 2026 21:03
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bdurand bdurand merged commit 9f0e4df into main Jan 6, 2026
5 checks passed
@bdurand bdurand deleted the remove-thread-locals branch January 6, 2026 17:02
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