Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2771

Allow awaited hello to fail with EOF when client is shutting down

    • Fully Compatible

      Mongoid test suite produces this failure:

      
      [2021-08-09 04:47:50.626]   1) Mongoid::Clients::Factory.create when provided a name when the configuration exists when the configuration is standard does not produce driver warnings
      [2021-08-09 04:47:50.626]      Failure/Error: Mongo::Logger.logger.should_not receive(:warn)
      [2021-08-09 04:47:50.626]      
      [2021-08-09 04:47:50.626]        (#<Logger:0x605c30f1 @default_formatter=#<Logger::Formatter:0x5f0b3bdb @datetime_format=nil>, @level=1, @progname=nil, @formatter=nil, @logdev=#<Logger::LogDevice:0x181240f0 @shift_age=nil, @shift_period_suffix=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @mon_mutex=#<Thread::Mutex:0xe80ea3a>, @shift_size=nil, @mon_owner=nil, @mon_count=0>>).warn(*(any args))
      [2021-08-09 04:47:50.626]            expected: 0 times with any arguments
      [2021-08-09 04:47:50.626]            received: 1 time with any arguments
      [2021-08-09 04:47:50.626]              call 1: ["MONGODB | Error running awaited hello on localhost:27017: Mongo::Error::SocketError: IOError: closed stream (for 127.0.0.1:27017 (no TLS)) (on localhost:27017)"]
      [2021-08-09 04:47:50.627]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/socket.rb:453:in `map_exceptions'
      [2021-08-09 04:47:50.627]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/socket.rb:243:in `write'
      [2021-08-09 04:47:50.627]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/server/monitor/connection.rb:122:in `block in write_bytes'
      [2021-08-09 04:47:50.627]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/server/connection_common.rb:117:in `add_server_diagnostics'
      [2021-08-09 04:47:50.627]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/server/monitor/connection.rb:121:in `block in write_bytes'
      [2021-08-09 04:47:50.628]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/server/monitor/connection.rb:245:in `add_server_connection_id'
      [2021-08-09 04:47:50.628]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/server/monitor/connection.rb:120:in `write_bytes'
      [2021-08-09 04:47:50.628]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/server/push_monitor.rb:166:in `write_check_command'
      [2021-08-09 04:47:50.628]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/server/push_monitor.rb:142:in `check'
      [2021-08-09 04:47:50.629]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/server/push_monitor.rb:100:in `block in do_work'
      [2021-08-09 04:47:50.629]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/monitoring.rb:330:in `publish_heartbeat'
      [2021-08-09 04:47:50.629]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/server/push_monitor.rb:99:in `do_work'
      [2021-08-09 04:47:50.629]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/background_thread.rb:115:in `block in start!'
      [2021-08-09 04:47:50.629]                from org/jruby/RubyKernel.java:1189:in `catch'
      [2021-08-09 04:47:50.629]                from /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/rubies/jruby-9.2.14.0/lib/ruby/gems/shared/gems/mongo-2.15.0/lib/mongo/background_thread.rb:113:in `block in start!'
      [2021-08-09 04:47:50.629]      # ./spec/mongoid/clients/factory_spec.rb:70:in `block in <main>'
      [2021-08-09 04:47:50.630]      # ./spec/lite_spec_helper.rb:68:in `block in /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/spec/lite_spec_helper.rb'
      [2021-08-09 04:47:50.630]      # ./spec/lite_spec_helper.rb:67:in `block in /data/mci/45df54d619fdcdc35f1ac0ffbe496a94/src/spec/lite_spec_helper.rb'
      [2021-08-09 04:47:50.630]
      

      When the client is closing, any errors from push monitor's connection should be ignored.

      This exception is only reproducing on JRuby.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: