Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3195

Driver aborts during bulk write

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.13.0
    • Component/s: Bulk API, libmongoc
    • None
    • Environment:
      Windows 10

      Driver aborts during bulk write because a precondition for "stream" fails.

       

      Here's the callstack.

       

      inmation.exe!abort() Line 77

      at d:\th\minkernel\crts\ucrt\src\appcrt\startup\abort.cpp(77)

      inmation.exe!mongoc_stream_writev(_mongoc_stream_t * stream, mongoc_iovec_t * iov, unsigned __int64 iovcnt, int timeout_msec) Line 154

      at c:\agent_work\5\s\buildtrees\mongo-c-driver\src\1.13.0-6ade1fe75c\src\libmongoc\src\mongoc\mongoc-stream.c(154)

      [Inline Frame] inmation.exe!mongoc_stream_writev(_mongoc_stream_t * timeout_msec, mongoc_iovec_t *) Line 165

      at c:\agent_work\5\s\buildtrees\mongo-c-driver\src\1.13.0-6ade1fe75c\src\libmongoc\src\mongoc\mongoc-stream.c(165)

      inmation.exe!_mongoc_stream_writev_full(_mongoc_stream_t * stream, mongoc_iovec_t * iov, unsigned __int64 iovcnt, int timeout_msec, _bson_error_t * error) Line 433

      at c:\agent_work\5\s\buildtrees\mongo-c-driver\src\1.13.0-6ade1fe75c\src\libmongoc\src\mongoc\mongoc-stream.c(433)

      inmation.exe!mongoc_cluster_run_opmsg(_mongoc_cluster_t * cluster, _mongoc_cmd_t * cmd, _bson_t * reply, _bson_error_t * error) Line 2771

      at c:\agent_work\5\s\buildtrees\mongo-c-driver\src\1.13.0-6ade1fe75c\src\libmongoc\src\mongoc\mongoc-cluster.c(2771)

      inmation.exe!mongoc_cluster_run_command_monitored(_mongoc_cluster_t * cluster, _mongoc_cmd_t * cmd, _bson_t * reply, _bson_error_t * error) Line 554

      at c:\agent_work\5\s\buildtrees\mongo-c-driver\src\1.13.0-6ade1fe75c\src\libmongoc\src\mongoc\mongoc-cluster.c(554)

      inmation.exe!_mongoc_write_opmsg(mongoc_write_command_t * command, _mongoc_client_t * client, _mongoc_server_stream_t * server_stream, const char * database, const char * collection, const _mongoc_write_concern_t * write_concern, unsigned int index_offset, _mongoc_client_session_t * cs, mongoc_write_result_t * result, _bson_error_t * error) Line 585

      at c:\agent_work\5\s\buildtrees\mongo-c-driver\src\1.13.0-6ade1fe75c\src\libmongoc\src\mongoc\mongoc-write-command.c(585)

      inmation.exe!_mongoc_write_command_execute_idl(mongoc_write_command_t * command, _mongoc_client_t * client, _mongoc_server_stream_t * server_stream, const char * database, const char * collection, unsigned int offset, const _mongoc_crud_opts_t * crud, mongoc_write_result_t * result) Line 973

      at c:\agent_work\5\s\buildtrees\mongo-c-driver\src\1.13.0-6ade1fe75c\src\libmongoc\src\mongoc\mongoc-write-command.c(973)

      inmation.exe!_mongoc_write_command_execute(mongoc_write_command_t * command, _mongoc_client_t * client, _mongoc_server_stream_t * server_stream, const char * database, const char * collection, const _mongoc_write_concern_t * write_concern, unsigned int offset, _mongoc_client_session_t * cs, mongoc_write_result_t * result) Line 874

      at c:\agent_work\5\s\buildtrees\mongo-c-driver\src\1.13.0-6ade1fe75c\src\libmongoc\src\mongoc\mongoc-write-command.c(874)

      inmation.exe!mongoc_bulk_operation_execute(_mongoc_bulk_operation_t * bulk, _bson_t * reply, _bson_error_t * error) Line 792

      at c:\agent_work\5\s\buildtrees\mongo-c-driver\src\1.13.0-6ade1fe75c\src\libmongoc\src\mongoc\mongoc-bulk-operation.c(792)

      inmation.exe!mongocxx::v_noabi::bulk_write::execute() Line 171

      at c:\agent_work\5\s\buildtrees\mongo-cxx-driver\src\r3.4.0-2d6ad5f494\src\mongocxx\bulk_write.cpp(171)

       

      A few things to note:

      1) We only do un-ordered writes.

      2) The mongodb server was very busy and probably unresponsive when this happened.

      3) My debugger says that error parameter to " _mongoc_stream_writev_full" has domain 2, code 4 and the message "Failed to send "update" command with database "HistoryTest": Failed to read 4 bytes: socket error or timeout".

      4) This crash seems to be the same as CDRIVER-1556 which is "fixed".

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            bhargavabhat@gmail.com Bh Sr
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: