<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:39:29 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>[GODRIVER-2845] Support for the waitQueueTimeoutMS connection parameter</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2845</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;It appears that the `waitQueueTimeoutMS` connection string parameter isn&apos;t supported by the Go driver yet. I thought it was because it&apos;s listed as an option on this page: &lt;a href=&quot;https://www.mongodb.com/docs/drivers/go/current/faq/#how-does-connection-pooling-work-in-the-go-driver-&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.mongodb.com/docs/drivers/go/current/faq/#how-does-connection-pooling-work-in-the-go-driver-&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ve tested this behaviour using 1.11.1 against MongoDB 5.0 by adding `waitQueueTimeoutMS=1&amp;amp;maxPoolSize=1` to my connection string and then adding lots of load on an endpoint that performs queries. What I saw was requests queueing up quickly and waiting for a long time until I stopped the test at which point they slowly recovered.&lt;/p&gt;

&lt;p&gt;Here&apos;s a visual representation of the &quot;sawtooth&quot; pattern that I saw during the test:&lt;/p&gt;

&lt;p&gt; &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;449588_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/449588/449588_image-2023-05-12-12-56-09-888.png&quot; title=&quot;image-2023-05-12-12-56-09-888.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;449588&quot; file-preview-title=&quot;image-2023-05-12-12-56-09-888.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/449588/_thumb_449588.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;

&lt;p&gt;This pattern is also what we&apos;re seeing in our production environment during traffic spikes. Requests are hanging for many seconds, sometimes minutes.&lt;/p&gt;

&lt;p&gt;Would it be possible to implement the `waitQueueTimeoutMS`, so waiting on a connection pool acquisition could be aborted quickly? Ideally, this would generate a PoolEvent, so we could track occurrences of this situation in our metrics.&lt;/p&gt;

&lt;p&gt;I found this old comment: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-211?focusedCommentId=1791246&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1791246&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/GODRIVER-211?focusedCommentId=1791246&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1791246&lt;/a&gt; . In case it&apos;s still the reason why this connection string parameter isn&apos;t supported I&apos;d like to offer a use case where that explanation isn&apos;t sufficient. In our case, we have some occasional long-running queries that are using the same client instance that&apos;s handling most of our traffic and making only quick queries. If we were to use a timeout on the context or on the client itself we would either cause the longer-running queries to fail unnecessarily (with a small timeout) or for goroutines to wait much longer than our users would when the connection pool is exhausted (with a long timeout). The `waitQueueTimeoutMS` option enables quick load shedding while allowing for longer timeouts under low-load conditions. In general, we would like queries to run for as long as they need to &lt;em&gt;if&lt;/em&gt; there&apos;re enough connections available in the pool, but fail &lt;em&gt;quickly&lt;/em&gt; if the pool is exhausted. Is there another way of accomplishing this without the `waitQueueTimeoutMS` option?&lt;/p&gt;</description>
                <environment></environment>
        <key id="2339777">GODRIVER-2845</key>
            <summary>Support for the waitQueueTimeoutMS connection parameter</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="13202">Works as Designed</resolution>
                                        <assignee username="preston.vasquez@mongodb.com">Preston Vasquez</assignee>
                                    <reporter username="dv@glyphy.com">D V</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 May 2023 17:24:02 +0000</created>
                <updated>Fri, 27 Oct 2023 13:16:20 +0000</updated>
                            <resolved>Thu, 1 Jun 2023 18:56:39 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5460352" author="dv@glyphy.com" created="Tue, 30 May 2023 14:20:14 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=preston.vasquez%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;preston.vasquez@mongodb.com&quot;&gt;preston.vasquez@mongodb.com&lt;/a&gt; Thanks for the suggested workaround! I think this should work in our case. We&apos;ll try it out within the next month or so.&lt;/p&gt;</comment>
                            <comment id="5453675" author="JIRAUSER1265158" created="Thu, 25 May 2023 22:18:49 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dv%40glyphy.com&quot; class=&quot;user-hover&quot; rel=&quot;dv@glyphy.com&quot;&gt;dv@glyphy.com&lt;/a&gt; , thank you for your detailed explanation! There is a drivers-wide initiative to deprecate &lt;tt&gt;waitQueueTimeoutMS&lt;/tt&gt; in favor of the client-side operation timeout functionality provided by &lt;a href=&quot;https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo/options#ClientOptions.SetTimeout&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;clientOptions.SetTimeout&lt;/a&gt;. The team would like to suggest a solution defining load-shedding logic on the user-side using the &lt;a href=&quot;https://pkg.go.dev/golang.org/x/sync/semaphore&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;x/sync/semaphore&lt;/a&gt; package: &lt;/p&gt;

&lt;p&gt;Gist: &lt;a href=&quot;https://gist.github.com/prestonvasquez/0092f606f6fec51330a656a67257fc2e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://gist.github.com/prestonvasquez/0092f606f6fec51330a656a67257fc2e&lt;/a&gt;&lt;br/&gt;
Go Playground: &lt;a href=&quot;https://go.dev/play/p/xGQyN6v9J6M&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://go.dev/play/p/xGQyN6v9J6M&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="5421459" author="dbeng-pm-bot" created="Fri, 12 May 2023 17:24:04 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dv%40glyphy.com&quot; class=&quot;user-hover&quot; rel=&quot;dv@glyphy.com&quot;&gt;dv@glyphy.com&lt;/a&gt;, thank you for reporting this issue! The team will look into it and get back to you soon. &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="449588" name="image-2023-05-12-12-56-09-888.png" size="118536" author="dv@glyphy.com" created="Fri, 12 May 2023 16:56:10 +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_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1.  What would you like to communicate to the user about this feature?&lt;br/&gt;
2.  Would you like the user to see examples of the syntax and/or executable code and its output?&lt;br/&gt;
3.  Which versions of the driver/connector does this apply to?&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1rac8:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>