nil pointer error in handler.rb

0 views
Skip to first unread message

benjackson

unread,
Sep 16, 2008, 3:49:02 PM9/16/08
to starling-discuss
For some reason today my worklings stopped talking to my starling
procs. It looks like a zombie workling_monitor was running, but while
looking into the starling logs I found this after restarting:

Starting at 127.0.0.1:15151.
I, [2008-09-16T10:26:24.538262 #22188] INFO -- : Starling STARTUP on
127.0.0.1:15151
E, [2008-09-16T10:26:49.637897 #22188] ERROR -- : Error handling
request: undefined method `>=' for nil:NilClass.
D, [2008-09-16T10:26:49.637999 #22188] DEBUG -- : /usr/local/lib/ruby/
gems/1.8/gems/starling-0.9.8/lib/starling/handler.rb:171:in `get'
/usr/local/lib/ruby/gems/1.8/gems/starling-0.9.8/lib/starling/
handler.rb:118:in `process'
/usr/local/lib/ruby/gems/1.8/gems/starling-0.9.8/lib/starling/
handler.rb:93:in `receive_data'
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/
eventmachine.rb:224:in `run_machine'
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/
eventmachine.rb:224:in `run'
/usr/local/lib/ruby/gems/1.8/gems/starling-0.9.8/lib/starling/
server.rb:90:in `run'
/usr/local/lib/ruby/gems/1.8/gems/starling-0.9.8/lib/starling/
server_runner.rb:154:in `start'
/usr/local/lib/ruby/gems/1.8/gems/starling-0.9.8/lib/starling/
server_runner.rb:33:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/starling-0.9.8/lib/starling/
server_runner.rb:12:in `new'
/usr/local/lib/ruby/gems/1.8/gems/starling-0.9.8/lib/starling/
server_runner.rb:12:in `run'
/usr/local/lib/ruby/gems/1.8/gems/starling-0.9.8/bin/starling:5
/usr/local/bin/starling:19:in `load'
/usr/local/bin/starling:19

The offending line is:

break if expiry == 0 || expiry >= now

This fails if expiry is nil. Not sure why it's nil in this case but
that's another question.

Patching the nil pointer in handler.rb seems to resolve the issue and
everything works as normal after killing the zombie proc and
restarting the workling.

Just an FYI, I'd send a patch but this is a quick fix.

Hasan Veldstra

unread,
Sep 17, 2008, 6:43:29 AM9/17/08
to starling...@googlegroups.com, benjackson

Ben, I'm guessing you meant to sent this to the list for Twitter's
Starling. This is a list for a different project with the same name.

Cheers

/Hasan

benjackson

unread,
Sep 17, 2008, 11:33:32 PM9/17/08
to starling-discuss
My mistake :)
Reply all
Reply to author
Forward
0 new messages