-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.10.0
-
Component/s: Replica Set
-
None
-
Environment:ruby 2.0.0-p451
I'm seeing exceptions raised when using threads and batch insert with the Replicasetclient
$ ./mongo_thread_bug.rb /Users/alextomlins/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/mongo-1.10.0/lib/mongo/collection_writer.rb:61:in `<': comparison of Fixnum with nil failed (ArgumentError) from /Users/alextomlins/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/mongo-1.10.0/lib/mongo/collection_writer.rb:61:in `block in batch_write_incremental' from /Users/alextomlins/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/mongo-1.10.0/lib/mongo/collection_writer.rb:57:in `catch' from /Users/alextomlins/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/mongo-1.10.0/lib/mongo/collection_writer.rb:57:in `batch_write_incremental' from /Users/alextomlins/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/mongo-1.10.0/lib/mongo/collection.rb:1158:in `batch_write' from /Users/alextomlins/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/mongo-1.10.0/lib/mongo/collection.rb:411:in `insert' from ./bug.rb:16:in `block in <main>'
I've created a minimal test case that exposes this: https://gist.github.com/alext/477f1eb13a90860de2bf
Note: if a read is done within the thread before doing the batch insert, it works fine.