<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:56:10 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>[JAVA-2034] Just after creating the mongo client, the mongo driver may lose a single operation</title>
                <link>https://jira.mongodb.org/browse/JAVA-2034</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;When multiple operations are executed on an async mongo client just after it has been created, a single operation may be lost, and no callback is fired or timeout occurs. This may lead to execution timeout errors in production code and may affect all async mongo users that use the client directly after initialisation.&lt;/p&gt;

&lt;p&gt;The attached example attempts to demonstrate the behavior. When the commented sleep() is uncommented, the example should always succeed. Otherwise, the example should fail most of the time with a &quot;1 remaining operations&quot; message. Note that sometimes, this example succeeds, please run it multiple times when the problem is not immediately present.&lt;/p&gt;</description>
                <environment></environment>
        <key id="238612">JAVA-2034</key>
            <summary>Just after creating the mongo client, the mongo driver may lose a single operation</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="peterhendriks">Peter Hendriks</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Nov 2015 14:22:09 +0000</created>
                <updated>Tue, 8 Dec 2015 14:15:50 +0000</updated>
                            <resolved>Fri, 13 Nov 2015 16:42:05 +0000</resolved>
                                    <version>3.1.0</version>
                                    <fixVersion>3.2.0</fixVersion>
                                    <component>Async</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1087953" author="xgen-internal-githook" created="Fri, 13 Nov 2015 16:41:25 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2034&quot; title=&quot;Just after creating the mongo client, the mongo driver may lose a single operation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2034&quot;&gt;&lt;del&gt;JAVA-2034&lt;/del&gt;&lt;/a&gt;: Stop interrupting the wait queue handler in BaseCluster, as it&apos;s possible that the interrupt flag will be checked somewhere else besides the wait queue handler itself.&lt;br/&gt;
Additionally, ensure that exceptions thrown in DefaultConnectionPool.getAsync are propagated to the callback.&lt;br/&gt;
Branch: 3.1.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/8f3bebff4daa49da43e64d2242afa3a5707a887b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/8f3bebff4daa49da43e64d2242afa3a5707a887b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1087936" author="xgen-internal-githook" created="Fri, 13 Nov 2015 16:29:53 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2034&quot; title=&quot;Just after creating the mongo client, the mongo driver may lose a single operation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2034&quot;&gt;&lt;del&gt;JAVA-2034&lt;/del&gt;&lt;/a&gt;: Stop interrupting the wait queue handler in BaseCluster, as it&apos;s possible that the interrupt flag will be checked somewhere else besides the wait queue handler itself.&lt;br/&gt;
Additionally, ensure that exceptions thrown in DefaultConnectionPool.getAsync are propagated to the callback.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/87113ea591aac67df11b728a33139b7b29547b7d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/87113ea591aac67df11b728a33139b7b29547b7d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1087223" author="jeff.yemin" created="Thu, 12 Nov 2015 21:50:48 +0000"  >&lt;p&gt;Hi Peter,&lt;/p&gt;

&lt;p&gt;We can reproduce this now and are looking for the root cause.&lt;/p&gt;

&lt;p&gt;Thanks again,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                            <comment id="1086801" author="peterhendriks" created="Thu, 12 Nov 2015 16:27:16 +0000"  >&lt;p&gt;I&apos;ve re-run the tests with your suggestions:&lt;/p&gt;

&lt;p&gt;1. Each time the test fails, _id value 0 is the only one missing from the collection.&lt;br/&gt;
2. Nothing specific happens by raising the timeout to 60 seconds. I actually expected a timeout error to be returned from the driver, but this also does not occur: the test simply waits until the timeout expires and no logging occurs other than some cluster status debug messages.&lt;/p&gt;</comment>
                            <comment id="1086770" author="jeff.yemin" created="Thu, 12 Nov 2015 16:11:29 +0000"  >&lt;p&gt;Hi Peter,&lt;/p&gt;

&lt;p&gt;A couple of follow-up questions:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;The documents have _id values from 0 to 499.  Which of those 500 documents is missing from the collection?&lt;/li&gt;
	&lt;li&gt;Does the same thing happen as you increase the timeout from 4 seconds to, say, 1 minute?&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Thanks,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                            <comment id="1086670" author="peterhendriks" created="Thu, 12 Nov 2015 15:04:04 +0000"  >&lt;p&gt;Hi Jeff, thanks for the follow-up. If I run the JAVA2034 example, I get the same problem at the first iteration, and the following value is printed:&lt;/p&gt;

&lt;p&gt;0: 1 remaining operations&lt;/p&gt;

&lt;p&gt;In the database, 499 documents are inserted out of the expected 500. On my machine, I need to add at least a sleep of 110 millis to make the example succeed. Note that we observed this problem on Linux and OSX, Java 1.8.0_60. I hope that helps! &lt;/p&gt;

</comment>
                            <comment id="1084917" author="jeff.yemin" created="Tue, 10 Nov 2015 21:16:17 +0000"  >&lt;p&gt;Hi Peter,&lt;/p&gt;

&lt;p&gt;I modified your test program a bit (see attached JAVA2034.java), making the following changes:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Added a loop at the top so that it doesn&apos;t have to be run over and over to get it to fail, and dropped the collection at the end of the loop (and slept for a second)&lt;/li&gt;
	&lt;li&gt;Check the return value of CountDownLatch.await, and only exit if it returns false (indicating a timeout).&lt;/li&gt;
	&lt;li&gt;Added some debug output&lt;/li&gt;
	&lt;li&gt;Changed the inserted document to set the _id to the loop counter.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;After 1000 iterations, I observed no failures.  Please try running this modified test and report back the results. If you do see a failure, please check the collection to see if there are actually any documents missing of the expected 200, and if so, which one(s).&lt;/p&gt;

&lt;p&gt;If you do get failures, I&apos;d also like to know if they continue to occur as you bump up the timeout value for the await to higher and higher values.&lt;/p&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;
</comment>
                            <comment id="1084393" author="peterhendriks" created="Tue, 10 Nov 2015 15:23:43 +0000"  >&lt;p&gt;Thanks mgardziejewski for the example code demonstrating the problem.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="97753" name="ConcurrentRequestsDuringStartupExample2.java" size="1216" author="peterhendriks" created="Tue, 10 Nov 2015 14:22:09 +0000"/>
                            <attachment id="97841" name="JAVA2034.java" size="2357" author="jeff.yemin@mongodb.com" created="Tue, 10 Nov 2015 21:22:37 +0000"/>
                    </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|hre893:</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="779">Java Sprint 28</customfieldvalue>

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