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

sc-server does not stop with ctrl-c and eats up cpu #86

Open
radbasa opened this issue Feb 27, 2012 · 6 comments
Open

sc-server does not stop with ctrl-c and eats up cpu #86

radbasa opened this issue Feb 27, 2012 · 6 comments

Comments

@radbasa
Copy link

radbasa commented Feb 27, 2012

I followed https://gist.github.com/1860325 and ran sc-server:

$ ./bin/sc-server --allow-from-ips="*.*.*.*"
SproutCore v1.7.1.beta Development Server
Allowing access only from IPs: *.*.*.*. Use --allow-from-ips='*.*.*.*' to allow all
Starting server at http://0.0.0.0:4020 in debug mode
To quit sc-server, press Control-C
>> Thin web server (v1.2.11 codename Bat-Shit Crazy)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4020, CTRL+C to stop
^C
^C^C^C
^C^C^C

I can't ctrl-C out of sc-server. I have to kill -9 it.

Also, accessing server:4020/todos with a browser pushes ruby to hit the roof. I am guessing this is sc-server. The welcome to sproutcore page also hasn't loaded after several minutes have passed.

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
17934 xxxxx   20   0 63496  55m 4304 R 99.5 11.1   6:37.57 ruby 

I will try a delete of abbot and then a reinstall.

@workmanw
Copy link

@radbasa Would you mind running sc-server with verbose for me?

sc-server --allow-from-ips="*.*.*.*" --verbose

Edit: Please delete your tmp directory first, then re-run sc-server with verbose.

@radbasa
Copy link
Author

radbasa commented Feb 27, 2012

@workmanw sorry, I've already redownloaded abbot.git.

Looks fine now. It's not using a lot of cpu now. But I still can't ctrl-c out.

sc-server with verbose: https://gist.github.com/1923934

@radbasa
Copy link
Author

radbasa commented Feb 27, 2012

Uh oh, spoke too soon. I just reloaded the page now, and I'm not getting any response. Ruby has hit 95% cpu use again.

last verbose log from sc-server is:
INFO 04:17:07.005 ~ Serving todos:source/main.js
INFO 04:19:28.002 ~ Serving todos:index.html

It might be because I've already sent ctrl-Cs to sc-server.

Edit: Yes, I believe the high CPU usage by ruby happens after I send a ctrl-C to sc-server, which doesn't stop, and I refresh the browser.

@radbasa
Copy link
Author

radbasa commented Feb 27, 2012

Filing a report of the irc session I had with unicolet regarding this issue.

Running on Ubuntu 11.04 (GNU/Linux 2.6.38-8-generic-pae i686),
Linux n0 2.6.38-8-generic-pae #42-Ubuntu SMP Mon Apr 11 05:17:09 UTC 2011 i686 i686 i386 GNU/Linux
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
also tried ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]

with sc-server running, and ctrl-c is sent, strace gave us:
gettimeofday({1329948762, 254615}, NULL) = 0
select(6, [3 5], [], [], {0, 90000}) = ? ERESTARTNOHAND (To be restarted)
--- SIGINT (Interrupt) @ 0 (0) ---
rt_sigreturn(0x6) = -1 EINTR (Interrupted system call)
clock_gettime(CLOCK_MONOTONIC, {32892, 297346880}) = 0
gettimeofday({1329948762, 266327}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1329948762, 266350485}) = 0
futex(0x98c68e8, FUTEX_WAIT_PRIVATE, 1, {0, 4976515}) = -1 ETIMEDOUT (Connection timed out)
futex(0x98c6930, FUTEX_WAKE_PRIVATE, 1) = 0

Installed sproutcore 1.8 on Ubuntu 10.04.2 LTS
Linux l0 2.6.32-28-generic-pae #55-Ubuntu SMP Mon Jan 10 22:34:08 UTC 2011 i686 GNU/Linux
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]

sc-server stops as it should when sent a ctrl-c

@unicolet
Copy link

I was able to reproduce it and turns out it is not a ruby or sproutcore issue, but rather a Linux kernel regression issue.
Easily fixed it by upgrading the kernel with:

  sudo  aptitude safe-upgrade

Reference: http://bugs.ruby-lang.org/issues/4777

@radbasa
Copy link
Author

radbasa commented Feb 28, 2012

It looks like it is isolated to Linus kernel 2.6.38 of which Ubuntu 11.04 is based on.

I tried safe-upgrade you mentioned, it didn't work for me.

I have since upgraded to Ubuntu 11.10. Without touching or reinstalling the abbot 1.8, ctrl-C works now.

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

No branches or pull requests

3 participants