<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:58:45 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-283] MongoDB exception 17234</title>
                <link>https://jira.mongodb.org/browse/CXX-283</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;Our installer is installing Mongo 2.6.1, then updating the database with some initial values.  On a few systems, we sometimes get a MongoDB exception:&lt;/p&gt;

&lt;p&gt;MongoDB Exception: 17234 backgroundJob already running: PeriodicTaskRunner&lt;/p&gt;

&lt;p&gt;When those systems get that error, they can never connect to Mongo (waiting &amp;amp; retrying repeatedly just returns the same error).&lt;/p&gt;

&lt;p&gt;We can&apos;t reproduce this on any of the development systems.  Any ideas on what might cause it?&lt;/p&gt;</description>
                <environment>Windows (2003, 2008, 2012)</environment>
        <key id="147022">CXX-283</key>
            <summary>MongoDB exception 17234</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="-1">Unassigned</assignee>
                                    <reporter username="rconn">Rex Conn</reporter>
                        <labels>
                            <label>legacy-cxx</label>
                    </labels>
                <created>Mon, 14 Jul 2014 18:46:09 +0000</created>
                <updated>Wed, 11 Sep 2019 19:05:20 +0000</updated>
                            <resolved>Thu, 11 Sep 2014 16:15:18 +0000</resolved>
                                    <version>legacy-0.0-26compat-2.6.0</version>
                                    <fixVersion>legacy-1.0.0-rc1</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="716801" author="xgen-internal-githook" created="Thu, 11 Sep 2014 16:14:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;samantharitter&apos;, u&apos;name&apos;: u&apos;Samantha Ritter&apos;, u&apos;email&apos;: u&apos;samantha.ritter@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-283&quot; title=&quot;MongoDB exception 17234&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-283&quot;&gt;&lt;del&gt;CXX-283&lt;/del&gt;&lt;/a&gt; Clarify documentation for startRunningPeriodicTasks&lt;br/&gt;
Branch: legacy&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/6a6435990175ff06c77c99fe1ba83614ae94b18d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/6a6435990175ff06c77c99fe1ba83614ae94b18d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="659648" author="acm" created="Tue, 15 Jul 2014 18:10:24 +0000"  >&lt;p&gt;Hi Rex -&lt;/p&gt;

&lt;p&gt;That makes sense. I&apos;m happy to hear you were able to find the issue and confirm a fix.&lt;/p&gt;

&lt;p&gt;I agree that calling mongo::client::initialize multiple times should have defined behavior, and it clearly shouldn&apos;t render the driver unusable in non-obvious ways. We would need to think about what the right behavior ought to be though, and, most likely, such a fix would only be applied on the legacy branch and not backported to 26compat.&lt;/p&gt;

&lt;p&gt;Do you mind if I leave this ticket open as a placeholder while we consider options for mongo::client::initialize? If you would prefer to close this since the root issue is sorted out, feel free to file an enhancement ticket in the CXX project requesting stronger behavior guarantees re mongo::client::initialize.&lt;/p&gt;</comment>
                            <comment id="659612" author="rconn" created="Tue, 15 Jul 2014 17:57:03 +0000"  >&lt;p&gt;Hi Andrew:&lt;/p&gt;

&lt;p&gt;I went back and looked through our code, and we were making a single call to client::initialize in the connection code.  However, the developer who did the db initialization code found that on slow systems (overloaded VM&apos;s in this case) MongoDB hadn&apos;t finished initializing when the first connection was attempted.  He added a loop to attempt to reconnect every few seconds, which resulted in client::initialize being called again.  Once that happened, we could never connect to Mongo.  (Is that WAD?)&lt;/p&gt;

&lt;p&gt;I moved the client::initialize call from the connect method to the constructor, and QA hasn&apos;t been able to reproduce the problem since.&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;

&lt;p&gt;Rex&lt;/p&gt;</comment>
                            <comment id="659356" author="acm" created="Tue, 15 Jul 2014 14:47:10 +0000"  >&lt;p&gt;There should be no direct calls to mongo::client::initialize in the driver code (barring tests/examples). A few comments:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;You mention that once this issue has arisen, subsequent connection attempts continue to return the same error. This suggests that the code path leading to establishing a connection is somehow leading (perhaps indirectly) to a call to startRunningPeriodTasks.&lt;/li&gt;
	&lt;li&gt;Do you use any sort of RAII pattern with a global static to manage invoking mongo::client::initialize and mongo::client::terminate? Is there any chance that this global static is in a DLL that gets loaded/unloaded?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;You stated that this is only happening on production systems, so that limits the diagnostic angles to some degree. Ideally if you had a dev system repro we could just add log messages / breakpoints in mongo::client::initialize, PeriodicTask::startRunningPeriodicTasks,  and friends and it would be easier to see if somehow these calls were getting repeated.&lt;/p&gt;

&lt;p&gt;Also, if you could provide information on how you built the client driver that would be useful as well.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Andrew&lt;/p&gt;
</comment>
                            <comment id="659320" author="rconn" created="Tue, 15 Jul 2014 14:28:12 +0000"  >&lt;p&gt;We&apos;re not &lt;b&gt;knowingly&lt;/b&gt; calling startRunningPeriodicTasks multiple times &amp;#8211; we don&apos;t have any explicit calls to it.  We do call client::initialize, but only once before connecting to Mongo.  (Is there another implicit call to client::initialize somewhere in the driver code?)&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

&lt;p&gt;Rex&lt;/p&gt;</comment>
                            <comment id="659207" author="acm" created="Tue, 15 Jul 2014 12:50:08 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rconn&quot; class=&quot;user-hover&quot; rel=&quot;rconn&quot;&gt;rconn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Is there any possibility that the function mongo::PeriodicTask::startRunningPeriodicTasks is being called more than once during the lifetime of your application? Keep in mind that mongo::client::initialize invokes PeriodicTask::startRunningPeriodicTasks once itself, so if the application is calling mongo::client::initialize, that already counts as one invocation of startRunningPeriodicTasks.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Andrew&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="151960">CXX-303</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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|hs0hkv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>127291</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>