How to get rid of "actor already terminated (Celluloid::DeadActorError)" warning

103 views Asked by At

I am getting a warning actor already terminated (Celluloid::DeadActorError) when I try stop Rails server using Ctrl + C

FYI, recently I have upgraded Rails application to version 6.1.7 with Ruby version 3.2.2.

Here is the stack trace of the error

=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 5.6.7 (ruby 3.2.2-p53) ("Birdie's Version")
*  Min threads: 0
*  Max threads: 5
*  Environment: development
*          PID: 12486
* Listening on http://127.0.0.1:3000
* Listening on http://[::1]:3000
Use Ctrl-C to stop
^C- Gracefully stopping, waiting for requests to finish
=== puma shutdown: 2023-11-07 15:39:16 +0530 ===
- Goodbye!
Exiting
bin/rails: warning: Exception in finalizer #<Proc:0x00007f905e3741f0 /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/evented_file_update_checker.rb:93>
/home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/proxies/actor_proxy.rb:34:in `terminate!': actor already terminated (Celluloid::DeadActorError)
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/proxies/actor_proxy.rb:27:in `terminate'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/proxies/cell_proxy.rb:60:in `terminate'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/listen-2.10.1/lib/listen/listener.rb:76:in `block in <class:Listener>'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/fsm.rb:175:in `instance_eval'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/fsm.rb:175:in `call'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/fsm.rb:127:in `transition_with_callbacks!'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/fsm.rb:95:in `transition'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/listen-2.10.1/lib/listen/listener.rb:108:in `stop'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/evented_file_update_checker.rb:113:in `stop'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/evented_file_update_checker.rb:94:in `block in finalizer'
bin/rails: warning: Exception in finalizer #<Proc:0x00007f90617787d0 /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/evented_file_update_checker.rb:93>
/home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/proxies/actor_proxy.rb:34:in `terminate!': actor already terminated (Celluloid::DeadActorError)
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/proxies/actor_proxy.rb:27:in `terminate'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/proxies/cell_proxy.rb:60:in `terminate'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/listen-2.10.1/lib/listen/listener.rb:76:in `block in <class:Listener>'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/fsm.rb:175:in `instance_eval'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/fsm.rb:175:in `call'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/fsm.rb:127:in `transition_with_callbacks!'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/celluloid-0.16.0/lib/celluloid/fsm.rb:95:in `transition'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/listen-2.10.1/lib/listen/listener.rb:108:in `stop'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/evented_file_update_checker.rb:113:in `stop'
    from /home/xxxx/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/evented_file_update_checker.rb:94:in `block in finalizer'

Also, commenting below line in config/environments/development.rb do not show above warning, though it is not recommended.

config.file_watcher = ActiveSupport::EventedFileUpdateChecker

1

There are 1 answers

0
suyogb On

As suggested by @dbugger and @digitalextremist, I tried updating the gem and it worked for me.

Added this in my Gemfile and run bundle install

gem 'celluloid', '~> 0.18.0'