undefined method success? for nil:NilClass

206 views
Skip to first unread message

Dump Hole

unread,
Jun 17, 2015, 3:35:33 AM6/17/15
to couc...@googlegroups.com
So I am running Sinatra app in a multi-threaded environment.  It seems the Ruby couchbase library isn't doing well.
I tried using both Rainbows and Puma, and they both yielded the same result.

I get a lot of these errors

NoMethodError - undefined method `success?' for nil:NilClass:
        /projects/nm/.bundle/ruby/2.2.0/gems/couchbase-1.3.11/lib/couchbase/view.rb:494:in `fetch_sync'
        /projects/nm/.bundle/ruby/2.2.0/gems/couchbase-1.3.11/lib/couchbase/view.rb:378:in `fetch'
        /projects/nm/.bundle/ruby/2.2.0/gems/couchbase-1.3.11/lib/couchbase/view.rb:200:in `each'
        /projects/nm/app/models/user.rb:227:in `map'


I tested this by running a puma server, with -t 8:32.
Then using ApacheBench:

ab -c 4 -n 100 "http://localhost:9091/user/dosomesearch"

This test is okay and doesn't produce errors:
ab -n 100 "http://localhost:9091/user/dosomesearch"

It seems that when there are multiple concurrent connections, the library isn't handling it well.  Is there a flag I need to enable for this?

Dump Hole

unread,
Jun 17, 2015, 4:02:11 AM6/17/15
to couc...@googlegroups.com
Did more digging.

Using multi processes instead of threads does not have the issue.  Either using unicorn, or puma with this settings:

puma -w 4 -t 1:1 --preload

So one thread per process.

Is this a known limitation?

Sergey Avseyev

unread,
Jun 17, 2015, 10:27:47 AM6/17/15
to Couchbase Google Group
Thanks for report. I will build a sample application to verify it
> --
> You received this message because you are subscribed to the Google Groups
> "Couchbase" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to couchbase+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages