<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:11:15 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>[CDRIVER-1001] Keep SDAM status (and connections to servers) in between multiple invocations to mongoc_client_new_from_uri</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-1001</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;I would like to request functionality that keeps SDAM status and connections in between calls to mongoc_client_new_from_uri. &lt;/p&gt;

&lt;p&gt;A PHP request is basically a request for an URL. Because PHP shares nothing among requests (not even the mongoc_client_t), the SDAM state is also not kept in between requests. Right now, PHPC only keeps connections in between PHP requests through persistent connections, a feature of PHP, where as HHVM does not do that either.&lt;/p&gt;

&lt;p&gt;My request is that the CDRIVER has a mode (or something else), where SDAM states for equivalent mongoc_client_t structures are kept even though the mongoc_client_t gets destroyed and created. And, in addition to keeping the SDAM state around, also connections that are managed by the CDRIVER itself. This is what the legacy PHP driver does as well, as to optimise checking server states, and not reconnecting to i.e. every replicaset member on each request.&lt;/p&gt;</description>
                <environment></environment>
        <key id="239743">CDRIVER-1001</key>
            <summary>Keep SDAM status (and connections to servers) in between multiple invocations to mongoc_client_new_from_uri</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="derick">Derick Rethans</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Nov 2015 13:08:49 +0000</created>
                <updated>Wed, 3 May 2017 22:14:57 +0000</updated>
                            <resolved>Thu, 28 Jan 2016 03:27:03 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1371325" author="jmikola@gmail.com" created="Mon, 29 Aug 2016 23:46:42 +0000"  >&lt;blockquote&gt;&lt;p&gt;HHVM driver will use mongoc_client_pool_new to create a pool on demand:&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Just to follow-up, HHVM-123 ended up persisting individual &lt;tt&gt;mongoc_client_t&lt;/tt&gt; objects between requests (hashed by the URI and other options used to create it) instead of using the pool API. &lt;a href=&quot;https://jira.mongodb.org/browse/PHPC-433&quot; title=&quot;Persist topology state between requests&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PHPC-433&quot;&gt;&lt;del&gt;PHPC-433&lt;/del&gt;&lt;/a&gt; will take the same approach as HHVM.&lt;/p&gt;</comment>
                            <comment id="1156199" author="jesse" created="Thu, 28 Jan 2016 03:27:03 +0000"  >&lt;p&gt;Closing this for now, feel free to reopen if there&apos;s anything the C Driver needs to do to support the HHVM driver.&lt;/p&gt;</comment>
                            <comment id="1154158" author="jesse" created="Tue, 26 Jan 2016 16:57:42 +0000"  >&lt;p&gt;HHVM driver will use mongoc_client_pool_new to create a pool on demand:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://api.mongodb.org/c/current/mongoc_client_pool_new.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.org/c/current/mongoc_client_pool_new.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;... then pop a client from the pool, use it, and return it. The pool maintains topology info and keeps it up to date with a background pthread. (&lt;a href=&quot;https://emptysqua.re/blog/server-discovery-and-monitoring-in-pymongo-perl-and-c/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;More info about monitoring implementation here&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;The pool&apos;s max size (default 100) counts clients in the pool &lt;b&gt;and&lt;/b&gt; clients currently checked out. Derick is concerned that PHP workers can die from errors without returning clients to the pool. Setting maxPoolSize=INT32_MAX will prevent  leaks from eventually deadlocking the application, something like:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongodb://host:port/?replicaSet=rs&amp;amp;maxPoolSize=2147483647&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;(That&apos;s 2 to the 31st, minus 1.)&lt;/p&gt;

&lt;p&gt;If we&apos;re very concerned that a buggy applicaiton could leak more than INT32_MAX clients before restarting, we can create a new feature for pools with unlimited max size.&lt;/p&gt;</comment>
                            <comment id="1154113" author="derick" created="Tue, 26 Jan 2016 16:34:49 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt; and I just had this meeting. It seems we could use a pool, and link it through a hash with a &quot;connection string + options&quot; together. &lt;/p&gt;</comment>
                            <comment id="1091514" author="derick" created="Wed, 18 Nov 2015 09:42:24 +0000"  >&lt;p&gt;No, because I don&apos;t know which URI / connection string people are going to use. Per PHP request, this URL can be totally different, and I can&apos;t keep a mongoc_client_pool_t between requests I believe - I would need to construct them up front... which I can&apos;t do as I don&apos;t know what to construct it for. Happy to chat about this if you&apos;d like!&lt;/p&gt;</comment>
                            <comment id="1090359" author="jesse" created="Tue, 17 Nov 2015 13:42:04 +0000"  >&lt;p&gt;Can you use a mongoc_client_pool_t? The pool implements this behavior.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="231577">PHPC-433</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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|hrdp8f:</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="812">C Driver 2015Q2 sprint 11</customfieldvalue>
    <customfieldvalue id="836">C Driver 2015Q2 sprint 12</customfieldvalue>
    <customfieldvalue id="865">C Driver 2016 sprint 1</customfieldvalue>
    <customfieldvalue id="894">C Driver 2016 sprint 2</customfieldvalue>

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