<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:55:44 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-1873] ConnectionPoolStatisticsMBean reports incorrect wait queue size if some thread was not able to enter the queue</title>
                <link>https://jira.mongodb.org/browse/JAVA-1873</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;com.mongodb.connection.DefaultConnectionPool::get invoke ConnectionPoolListener::waitQueueEntered only when it is actually possible to enter the queue (waitQueueSize &amp;lt;= MaxWaitQueueSize), but ConnectionPoolListener::waitQueueExited is invoked in finally clause every time DefaultConnectionPool::get is invoked (&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/master/driver-core/src/main/com/mongodb/connection/DefaultConnectionPool.java#L84&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/blob/master/driver-core/src/main/com/mongodb/connection/DefaultConnectionPool.java#L84&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;As a result, every time MongoWaitQueueFullException is thrown due to full wait queue, waitQueueSize in com.mongodb.management.ConnectionPoolStatistics is decremented. And eventually it may become negative.&lt;/p&gt;

&lt;p&gt;I&apos;ve hit this issue with pretty old 2.12.4 driver, but according to sources it should be reproducible with latest driver.&lt;/p&gt;

&lt;p&gt;Suggested fix in attachment.&lt;/p&gt;</description>
                <environment></environment>
        <key id="212713">JAVA-1873</key>
            <summary>ConnectionPoolStatisticsMBean reports incorrect wait queue size if some thread was not able to enter the queue</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="fzhinkin">Filipp Zhinkin</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Jun 2015 13:17:44 +0000</created>
                <updated>Thu, 16 Jul 2015 16:01:12 +0000</updated>
                            <resolved>Wed, 15 Jul 2015 19:03:35 +0000</resolved>
                                    <version>2.12.4</version>
                    <version>3.0.2</version>
                                    <fixVersion>3.0.3</fixVersion>
                    <fixVersion>3.1.0</fixVersion>
                                    <component>Connection Management</component>
                    <component>Monitoring</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="967899" author="jeff.yemin" created="Thu, 16 Jul 2015 16:01:12 +0000"  >&lt;p&gt;Fix is now available in the &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/releases/tag/r3.0.3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;3.0.3 release&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="967140" author="xgen-internal-githook" created="Wed, 15 Jul 2015 20:21:55 +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: In the connection pool, moved wait queue size increment into its own try block so that wait queue start and end events are only delivered if the wait queue is actually entered.&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1873&quot; title=&quot;ConnectionPoolStatisticsMBean reports incorrect wait queue size if some thread was not able to enter the queue&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1873&quot;&gt;&lt;del&gt;JAVA-1873&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: 3.0.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/f7bb1d7e51c7251d558b1a9ffe802389cc22e798&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/f7bb1d7e51c7251d558b1a9ffe802389cc22e798&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="967113" author="xgen-internal-githook" created="Wed, 15 Jul 2015 19:58:12 +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: In the connection pool, moved wait queue size increment into its own try block so that wait queue start and end events are only delivered if the wait queue is actually entered.&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1873&quot; title=&quot;ConnectionPoolStatisticsMBean reports incorrect wait queue size if some thread was not able to enter the queue&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1873&quot;&gt;&lt;del&gt;JAVA-1873&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/378cbe769ac884e9eb1b0787e8663f6be6adb941&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/378cbe769ac884e9eb1b0787e8663f6be6adb941&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="967040" author="xgen-internal-githook" created="Wed, 15 Jul 2015 19:03:24 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;fzhinkin&apos;, u&apos;name&apos;: u&apos;Filipp Zhinkin&apos;, u&apos;email&apos;: u&apos;filipp.zhinkin@gmail.com&apos;}
&lt;p&gt;Message: Notify listener about wait queue enter before throwing an exception if the queue is full.&lt;/p&gt;

&lt;p&gt;  &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1873&quot; title=&quot;ConnectionPoolStatisticsMBean reports incorrect wait queue size if some thread was not able to enter the queue&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1873&quot;&gt;&lt;del&gt;JAVA-1873&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: 3.0.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/93fb8501c9afd0d9e5dae637ec29a85e318dc7ef&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/93fb8501c9afd0d9e5dae637ec29a85e318dc7ef&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="967031" author="xgen-internal-githook" created="Wed, 15 Jul 2015 18:58:09 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;fzhinkin&apos;, u&apos;name&apos;: u&apos;Filipp Zhinkin&apos;, u&apos;email&apos;: u&apos;filipp.zhinkin@gmail.com&apos;}
&lt;p&gt;Message: Notify listener about wait queue enter before throwing an exception if the queue is full.&lt;/p&gt;

&lt;p&gt;  &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1873&quot; title=&quot;ConnectionPoolStatisticsMBean reports incorrect wait queue size if some thread was not able to enter the queue&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1873&quot;&gt;&lt;del&gt;JAVA-1873&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/34ad2bbf421bcb2436c1b2b6b880f548de0e0a4d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/34ad2bbf421bcb2436c1b2b6b880f548de0e0a4d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="949164" author="jeff.yemin" created="Wed, 24 Jun 2015 13:27:32 +0000"  >&lt;p&gt;Thanks Filipp,&lt;/p&gt;

&lt;p&gt;Would you like to open a pull request so that your name is associated with the fix in the Github commit?&lt;/p&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="79155" name="wait_queue_events_fix.patch" size="5045" author="fzhinkin" created="Wed, 24 Jun 2015 13:17:44 +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|hsb7fb:</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="522">Java Sprint 20</customfieldvalue>

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