Skip to content

TimerSet's priority queue has nil elements #193

@gmalkas

Description

@gmalkas

Hey,

it seems TimerSet's priority queue has some nil elements:

NoMethodError: undefined method `time' for nil:NilClass
    /.bundle/jruby/1.9/bundler/gems/concurrent-ruby-48c74dee7152/lib/concurrent/executor/timer_set.rb:108 :in `<=>`
    /.bundle/jruby/1.9/bundler/gems/concurrent-ruby-48c74dee7152/lib/concurrent/collection/priority_queue.rb:276 :in `pop`
    /.bundle/jruby/1.9/bundler/gems/concurrent-ruby-48c74dee7152/lib/concurrent/executor/timer_set.rb:139 :in `process_tasks`
    /.bundle/jruby/1.9/bundler/gems/concurrent-ruby-48c74dee7152/lib/concurrent/executor/timer_set.rb:131 :in `process_tasks`

Here is the state of variables when the exception was raised:

    {
      "self" => "#<struct Concurrent::TimerSet::Task time=1416912118.263, args=[#<Concurrent::Event:0x59a176fc @mutex=#<Mutex:0x38684d54>, @condition=#<Concurrent::Condition:0x47ace2ba @condition=#<ConditionVariable:0x27594619>>, @set=false>], op=#<Proc:0x5609277d@/.bundle/jruby/1.9/bundler/gems/concurrent-ruby-48c74dee7152/lib/concurrent/timer_task.rb:318 (lambda)>>",
      "other" => "nil"
    }

This seems a bit strange to me, as reading through TimerSet code I do not see how a nil element could be pushed onto the queue.

Any idea?

Version information:
concurrent-ruby 0.7.0
jruby 1.7.16.1 on Java 8

Thanks!

Metadata

Metadata

Labels

bugA bug in the library or documentation.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions