Skip to content

Add after filters in adapters to clear Authlogic::Session::Base.controller? #335

@tiegz

Description

@tiegz

I'm experiencing a strange error in Rails 3.2 where the thread-local controller variable is different than the current request's controller. Having a hard time tracking it down, but we're using Unicorn (forked processes) and virtually have no threading in our app, so I'm having a hard time figuring it out.

The place where this occurs is when we override append_info_to_payload in ApplicationController (which is used in the action_controller instrumentation). We just append information to the instrumentation payload that references the current user, via Authlogic. Every once in a while, an error will be raised in this overriden method that indicates the Authlogic controller isn't the same as the current one.

My question is: wouldn't it be a good idea to use an after_filter (in Rails adapter, for example) to unset Authlogic::Session::Base.controller after the request to ensure that the var doesn't stick around?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions