Skip to content
This repository has been archived by the owner on May 25, 2018. It is now read-only.

undefined method `pop' for nil:NilClass #91

Open
clairezed opened this issue Jun 3, 2016 · 3 comments
Open

undefined method `pop' for nil:NilClass #91

clairezed opened this issue Jun 3, 2016 · 3 comments

Comments

@clairezed
Copy link

  • ruby 2.1.2
  • rails '4.1.6'
  • faye-rails 2.0.0

With no identified reason and inconsistently, this error is raised once or twice a day, for an app in production, by two lines of an app in production. One of the line is called from a background task, the other isn't.

These 2 lines are refers to a version of FayeRails::Controller.publish(), that raises an error directly in eventmachine :

extract from eventmachine code

def set_deferred_status status, *args
      cancel_timeout
      @errbacks ||= nil
      @callbacks ||= nil
      @deferred_status = status
      @deferred_args = args
      case @deferred_status
      when :succeeded
        if @callbacks
          while cb = @callbacks.pop # This line raises the error =========
            cb.call(*@deferred_args)
          end
        end
        @errbacks.clear if @errbacks
      when :failed
        if @errbacks
          while eb = @errbacks.pop
            eb.call(*@deferred_args)
          end
        end
        @callbacks.clear if @callbacks
      end
    end

How comes FayeRails::Controller could have no @callbacks ? Have you met this before ?

It may be linked with my comment on #73 as it raises also on FayeRails::Controller.publish()

@gwynm
Copy link

gwynm commented Feb 27, 2017

Clairezed, did you ever solve this? It's just started appearing for me.

@tombeynon
Copy link

@clairezed @gwynm also seeing this issue, did you guys get anywhere with it? I expect it's some kind of threading edge case but will investigate further.

@ohmycto
Copy link

ohmycto commented Aug 9, 2017

Same thing.

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

No branches or pull requests

4 participants