Skip to content

`synchronize': can't be called from trap context (ThreadError) #565

@aaronjensen

Description

@aaronjensen

This particular warning happens in a Rails app when using Puma. I don't know that there is anything that Puma or Rails can do differently here to prevent this from happening, but I will report it in Rails as well (perhaps stopping listener in a finalizer is just wrong because of this). I believe it's happening when Puma is stopping a thread and a GC happens. The rest of the stack trace was application code, so it was clearly a signal.

my-app/gems/ruby/3.1.0/gems/actionview-7.0.4/lib/action_view/helpers/tag_helper.rb:189: warning: Exception in finalizer #<Proc:0x000000010852fb80 my-app/gems/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/evented_file_update_checker.rb:91>
my-app/gems/ruby/3.1.0/gems/listen-3.7.1/lib/listen/fsm.rb:80:in `synchronize': can't be called from trap context (ThreadError)
        from my-app/gems/ruby/3.1.0/gems/listen-3.7.1/lib/listen/fsm.rb:80:in `transition!'
        from my-app/gems/ruby/3.1.0/gems/listen-3.7.1/lib/listen/fsm.rb:104:in `transition_with_callbacks!'
        from my-app/gems/ruby/3.1.0/gems/listen-3.7.1/lib/listen/fsm.rb:72:in `transition'
        from my-app/gems/ruby/3.1.0/gems/listen-3.7.1/lib/listen/listener.rb:103:in `stop'
        from my-app/gems/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/evented_file_update_checker.rb:111:in `stop'
        from my-app/gems/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/evented_file_update_checker.rb:92:in `block in finalizer'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions