Skip to content

Instantly share code, notes, and snippets.

@cgriego
Created August 16, 2011 21:08
Show Gist options
  • Save cgriego/1150184 to your computer and use it in GitHub Desktop.
Save cgriego/1150184 to your computer and use it in GitHub Desktop.
MacBook Pro Early 2011, Lion, REE 2011.03, Mongo, forking #=> Errno::EINVAL
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'mongo'
@conn = Mongo::Connection.new
@db = @conn['supply_chain_development']
puts @db['properties'].find.to_a.size
pid = fork do
puts @db['properties'].find.to_a.size
exit
end
Process.waitpid pid
puts "end"
# forked process crashes with:
# gems/mongo-1.3.1/lib/../lib/mongo/util/pool.rb:131:in `close': Invalid argument (Errno::EINVAL)
# from gems/mongo-1.3.1/lib/../lib/mongo/util/pool.rb:131:in `checkout_existing_socket'
# from gems/mongo-1.3.1/lib/../lib/mongo/util/pool.rb:154:in `checkout'
# from gems/mongo-1.3.1/lib/../lib/mongo/util/pool.rb:152:in `synchronize'
# from gems/mongo-1.3.1/lib/../lib/mongo/util/pool.rb:152:in `checkout'
# from gems/mongo-1.3.1/lib/../lib/mongo/util/pool.rb:145:in `loop'
# from gems/mongo-1.3.1/lib/../lib/mongo/util/pool.rb:145:in `checkout'
# from gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:579:in `checkout_reader'
# from gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:477:in `receive_message'
# from gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:407:in `send_initial_query'
# from gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:609:in `instrument'
# from gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:406:in `send_initial_query'
# from gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:371:in `refresh'
# from gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:87:in `next_document'
# from gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:248:in `each'
# from gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:267:in `to_a'
# from gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:267:in `to_a'
# from ./einval.rb:13
# from ./einval.rb:12:in `fork'
# from ./einval.rb:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment