celluloid/celluloid — pull request #268 by halorgium (2013-05-29 22:43:29+00:00)
Title: Revert problematic Actor-locals

The change we are reverting added shared state across the whole `Actor`:
* the main `Actor` thread,
* all `Task`s,
* `TaskThread`s,
* `TaskFiber`s.

Introduced in #224 and #236.

There are problems with this approach.
See mperham/sidekiq#954, mperham/sidekiq#960

1. Inter-`Actor` locals access is thread-unsafe. This is because the `Hash` backing the locals is reachable from all `Thread`s.
2. `Task`s now share the same thread-local storage, which breaks the previous contract. For some uses, this is convenient (eg. `ActiveRecord` connection pooling), but can also cause unexpected issues.

The feature is definitely useful, but more consideration of existing usage is necessary. The way in which this functionality is provided to users requires further discussion.

/cc @tarcieri @mperham @benlangfeld