resque/resque — pull request #1152 by RunsFor (2013-12-06 13:55:55+00:00)
Title: Interrupted system call - hostname (Errno::EINTR)

Hi,
I'm not sure if it is the right place to post my question, but the problem is occur from the rescue code and it seems to be platform dependent.

I have 21 different types of workers and I start them up using rescue-pool gem. This error occurs more often when my macbook air is busy. After restarting the system its much likely to run without such errors.

Here the error output I got:

```
00:13:57 worker.1 | /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/activesupport-3.2.15/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``': Interrupted system call - hostname (Errno::EINTR)
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/activesupport-3.2.15/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-1.25.1/lib/resque/worker.rb:651:in `hostname'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-1.25.1/lib/resque/worker.rb:644:in `to_s'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-1.25.1/lib/resque/worker.rb:608:in `job'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-1.25.1/lib/resque/worker.rb:537:in `unregister_worker'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-1.25.1/lib/resque/worker.rb:215:in `rescue in work'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-1.25.1/lib/resque/worker.rb:162:in `work'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:326:in `block in spawn_worker!'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:321:in `fork'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:321:in `spawn_worker!'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:300:in `block in spawn_missing_workers_for'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:299:in `times'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:299:in `spawn_missing_workers_for'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:285:in `block in maintain_worker_count'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:283:in `each'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:283:in `maintain_worker_count'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:198:in `start'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool.rb:72:in `run'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool/tasks.rb:17:in `block (2 levels) in '
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
00:13:57 worker.1 |	from /Users/runfor/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool/cli.rb:114:in `start_pool'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/lib/resque/pool/cli.rb:16:in `run'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/gems/resque-pool-0.3.0/bin/resque-pool:7:in `'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/bin/resque-pool:23:in `load'
00:13:57 worker.1 |	from /Users/runfor/.rvm/gems/ruby-2.0.0-p247@wc/bin/resque-pool:23:in `

'
```

And here is my system name:

```
runfor@MacBook-Air-Ila|master⚡ ⇒ uname -a
Darwin MacBook-Air-Ila.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
```

Here I found some workaround related to this topic:
http://www.mac-help.com/threads/interrupted-system-call.210190/

Thanks!