<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:00:20 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CXX-787] multithreaded application hangs during bulk load</title>
                <link>https://jira.mongodb.org/browse/CXX-787</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;We have a multi-threaded app doing bulk loading (each thread loading different set of data), with 10 thread, all threads are hanging with the same call stack. &lt;/p&gt;

&lt;p&gt;#0  0x0000003ba820eb5c in recv () from /lib64/libpthread.so.0&lt;br/&gt;
#1  0x00007f291f2d36cf in mongo::Socket::_recv(char*, int) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#2  0x00007f291f2d36f9 in mongo::Socket::unsafe_recv(char*, int) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#3  0x00007f291f2d373f in mongo::Socket::recv(char*, int) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#4  0x00007f291f2cb514 in mongo::MessagingPort::recv(mongo::Message&amp;amp;) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#5  0x00007f291f2cc4c2 in mongo::MessagingPort::recv(mongo::Message const&amp;amp;, mongo::Message&amp;amp;) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#6  0x00007f291f25c629 in mongo::DBClientConnection::call(mongo::Message&amp;amp;, mongo::Message&amp;amp;, bool, std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt;*) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#7  0x00007f291f2790b1 in mongo::DBClientCursor::init() () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#8  0x00007f291f24906d in mongo::DBClientBase::query(std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;, mongo::Query, int, int, mongo::BSONObj const*, int, int) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#9  0x00007f291f25c4d3 in mongo::DBClientConnection::query(std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;, mongo::Query, int, int, mongo::BSONObj const*, int, int) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#10 0x00007f291f25b2d2 in mongo::DBClientInterface::findN(std::vector&amp;lt;mongo::BSONObj, std::allocator&amp;lt;mongo::BSONObj&amp;gt; &amp;gt;&amp;amp;, std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;, mongo::Query, int, int, mongo::BSONObj const*, int, int) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#11 0x00007f291f25b640 in mongo::DBClientInterface::findOne(std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;, mongo::Query const&amp;amp;, mongo::BSONObj const*, int) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#12 0x00007f291f2551e0 in mongo::DBClientWithCommands::runCommand(std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;, mongo::BSONObj const&amp;amp;, mongo::BSONObj&amp;amp;, int) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#13 0x00007f291f255353 in mongo::DBClientConnection::runCommand(std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;, mongo::BSONObj const&amp;amp;, mongo::BSONObj&amp;amp;, int) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#14 0x00007f291f245488 in mongo::CommandWriter::_send(mongo::BSONObjBuilder*, mongo::WriteConcern const*, mongo::StringData const&amp;amp;) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#15 0x00007f291f245f1c in mongo::CommandWriter::write(mongo::StringData const&amp;amp;, std::vector&amp;lt;mongo::WriteOperation*, std::allocator&amp;lt;mongo::WriteOperation*&amp;gt; &amp;gt; const&amp;amp;, bool, mongo::WriteConcern const*, mongo::WriteResult*) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#16 0x00007f291f24a93d in mongo::DBClientBase::_write(std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;, std::vector&amp;lt;mongo::WriteOperation*, std::allocator&amp;lt;mongo::WriteOperation*&amp;gt; &amp;gt; const&amp;amp;, bool, mongo::WriteConcern const*, mongo::WriteResult*) () from /opt/mtx/lib/libmongoclient.so&lt;br/&gt;
#17 0x00007f291f565b0f in EventLoader::EventLoaderWorkerTask::commitBulk(mongo::BulkOperationBuilder&amp;amp;, std::vector&amp;lt;mongo::BSONObj, std::allocator&amp;lt;mongo::BSONObj&amp;gt; &amp;gt;&amp;amp;, char const*) () from /opt/mtx/lib/libevent_loader.so&lt;/p&gt;</description>
                <environment></environment>
        <key id="244929">CXX-787</key>
            <summary>multithreaded application hangs during bulk load</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="andrew.morrow@mongodb.com">Andrew Morrow</assignee>
                                    <reporter username="Judy.Han">Judy Han [X]</reporter>
                        <labels>
                            <label>legacy-cxx</label>
                    </labels>
                <created>Wed, 23 Dec 2015 00:26:11 +0000</created>
                <updated>Fri, 1 Jan 2016 22:51:20 +0000</updated>
                            <resolved>Fri, 1 Jan 2016 22:51:20 +0000</resolved>
                                    <version>legacy-1.0.6</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1124695" author="acm" created="Fri, 1 Jan 2016 22:51:20 +0000"  >&lt;p&gt;Thanks for getting back to me with those answers, and I&apos;m happy to hear that you were able to develop an understanding of the behavior you are observing. I&apos;m closing this ticket, but feel free to ping it if you have further questions about the C++ driver.&lt;/p&gt;</comment>
                            <comment id="1124333" author="judy.han" created="Wed, 30 Dec 2015 23:49:16 +0000"  >&lt;p&gt;Hi Andrew,&lt;br/&gt;
Thanks for the response. Thanks for your questions.&lt;br/&gt;
We just figured out what the problem is - we are missing one index and the database is quite big and the upsert is taking a long long time...&lt;br/&gt;
Please feel free to close the ticket.&lt;br/&gt;
Thanks you very much!&lt;br/&gt;
Judy&lt;/p&gt;

&lt;p&gt;Here are the answers to your questions in case you still want to know:&lt;br/&gt;
1. yes, each thread use a separate DBClientBase object.&lt;br/&gt;
2. yes, I am able to connect via mongo from the same machine where I ran the app and able to issue queries and inserts, but updates are hanging.&lt;br/&gt;
3. mongodb_writeconcern is 1, mongodb_wtimeout is 1 ms, the replication &lt;br/&gt;
4. no replication, no sharding, here is the configuration file:&lt;/p&gt;</comment>
                            <comment id="1124017" author="acm" created="Wed, 30 Dec 2015 16:19:17 +0000"  >&lt;p&gt;Hi Judy - &lt;/p&gt;

&lt;p&gt;That call stack looks pretty normal. It looks more like the client thread is just waiting for a response from the server. I have a few questions:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Does each thread use a separate DBClientBase object? They aren&apos;t safe to share across threads.&lt;/li&gt;
	&lt;li&gt;Are the servers with which you are communicating acting normally? In other words, during the bulk load, can you issue queries and updates against them?&lt;/li&gt;
	&lt;li&gt;What WriteConcern are you using? Could this simply be awaiting replication?&lt;/li&gt;
	&lt;li&gt;What is the topology of the cluster (replication? sharding?)&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsf4y7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="801">Platforms E (01/08/16)</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>