Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl-C with WEBrick crashes with SystemExit #1696

Open
denisdefreyne opened this issue Apr 12, 2024 · 1 comment
Open

Ctrl-C with WEBrick crashes with SystemExit #1696

denisdefreyne opened this issue Apr 12, 2024 · 1 comment

Comments

@denisdefreyne
Copy link
Member

Steps to reproduce

  1. Create a Nanoc site with a Gemfile not containing puma
  2. Run bundle exec nanoc view
  3. Type ctrl+C

Expected behavior

Nanoc shuts down without error message.

Actual behavior

[2024-04-12 18:56:54] FATAL SystemExit: exit followed by a stack trace.

Details

See #1695 (reply in thread).

Crash log

n/a

@stefanos82
Copy link

I have the impression this behavior is related to ruby/webrick#102, because based on my limited investigation deciphering this thrown error message output

stefanos@debian:tutorial $ bin/nanoc view
View the site at http://127.0.0.1:3000/
[2024-04-12 22:07:51] INFO  WEBrick 1.8.1
[2024-04-12 22:07:51] INFO  ruby 3.1.2 (2022-04-12) [x86_64-linux-gnu]
[2024-04-12 22:07:51] INFO  WEBrick::HTTPServer#start: pid=13337 port=3000
^C
[2024-04-12 22:07:53] FATAL SystemExit: exit
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli/error_handler.rb:41:in `exit'
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli/error_handler.rb:41:in `block (2 levels) in handle_while'
        /usr/share/rubygems-integration/all/gems/webrick-1.8.1/lib/webrick/server.rb:173:in `select'
        /usr/share/rubygems-integration/all/gems/webrick-1.8.1/lib/webrick/server.rb:173:in `block in start'
        /usr/share/rubygems-integration/all/gems/webrick-1.8.1/lib/webrick/server.rb:32:in `start'
        /usr/share/rubygems-integration/all/gems/webrick-1.8.1/lib/webrick/server.rb:160:in `start'
        /home/stefanos/gems/gems/rackup-2.1.0/lib/rackup/handler/webrick.rb:34:in `run'
        /home/stefanos/gems/gems/adsf-1.5.0/lib/adsf/server.rb:37:in `run'
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli/commands/view.rb:37:in `run'
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli/command_runner.rb:15:in `block in call'
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli/error_handler.rb:57:in `handle_while'
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli/error_handler.rb:15:in `handle_while'
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli/command_runner.rb:14:in `call'
        /home/stefanos/gems/gems/cri-2.15.11/lib/cri/command_dsl.rb:294:in `block in runner'
        /home/stefanos/gems/gems/cri-2.15.11/lib/cri/command.rb:362:in `run_this'
        /home/stefanos/gems/gems/cri-2.15.11/lib/cri/command.rb:298:in `run'
        /home/stefanos/gems/gems/cri-2.15.11/lib/cri/command.rb:316:in `run'
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli.rb:88:in `block in run'
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli/error_handler.rb:57:in `handle_while'                                                                                         
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli/error_handler.rb:15:in `handle_while'                                                                                         
        /home/stefanos/gems/gems/nanoc-cli-4.12.20/lib/nanoc/cli.rb:86:in `run'                                                                                                                
        /home/stefanos/gems/gems/nanoc-4.12.20/bin/nanoc:18:in `<top (required)>'                                                                                                              
        bin/nanoc:27:in `load'                                                                                                                                                                 
        bin/nanoc:27:in `<main>'                                                                                                                                                               
[2024-04-12 22:07:53] INFO  going to shutdown ...                                                                                                                                              
[2024-04-12 22:07:53] INFO  WEBrick::HTTPServer#start done.

seems like the server does not have the time to stop / kill all running spawned processes, which throws this message.

Most probably though I've got things wrong, but it's a plausible hypothesis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants