[CCBC-59] libcouchbase_wait() blocks forever if there is nothing queued Created: 22/Mar/12  Updated: 13/Nov/12  Resolved: 10/Apr/12

Status: Closed
Project: Couchbase C client library libcouchbase
Component/s: library
Affects Version/s: 1.0, 1.0.2
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Critical
Reporter: James Assignee: Sergey Avseyev
Resolution: Fixed Votes: 0
Labels: critical
Remaining Estimate: 8h
Time Spent: Not Specified
Original Estimate: 8h
Environment: Linux Centos 5.7

Attachments: File couchbase_bug.c    

Very simply, if you call libcouchbase_wait() without queuing some operation first (e.g store a key/value, arithmetic, etc...)
the call to libcouchbase_wait() never returns.

This means that a single threaded application that calls libcouchbase_wait() at different times to make sure operations are sent to the server runs the risk of stalling indefinitely. This is a very likely scenario.

I've attached a simple proof of concept, which never completes. If you uncomment the store operation, the program completes successfully.

Comment by Sergey Avseyev [ 09/Apr/12 ]
Fix published http://review.couchbase.org/14696
Generated at Wed Dec 17 22:05:48 CST 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.