<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:56:34 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>[SERVER-1273] Can&apos;t include bson/bson.h and client/connpool.h in same file due to msgasserted conflict</title>
                <link>https://jira.mongodb.org/browse/SERVER-1273</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Given the current git head, the following file will not compile:&lt;/p&gt;


&lt;p&gt;#include &amp;lt;cmath&amp;gt;&lt;br/&gt;
#include &amp;lt;cstring&amp;gt;&lt;br/&gt;
#include &amp;lt;mongo/bson/bson.h&amp;gt;&lt;br/&gt;
#include &amp;lt;mongo/client/connpool.h&amp;gt;&lt;/p&gt;


&lt;p&gt;It fails as follows:&lt;/p&gt;


&lt;p&gt;In file included from /afs/acr/users/acm/mongo.temp.install/include/mongo/client/../util/../util/../db/../util/optime.h:20,&lt;br/&gt;
                 from /afs/acr/users/acm/mongo.temp.install/include/mongo/client/../util/../util/../db/jsobj.h:33,&lt;br/&gt;
                 from /afs/acr/users/acm/mongo.temp.install/include/mongo/client/../util/../util/sock.h:25,&lt;br/&gt;
                 from /afs/acr/users/acm/mongo.temp.install/include/mongo/client/../util/message.h:20,&lt;br/&gt;
                 from /afs/acr/users/acm/mongo.temp.install/include/mongo/client/dbclient.h:21,&lt;br/&gt;
                 from /afs/acr/users/acm/mongo.temp.install/include/mongo/client/connpool.h:21,&lt;br/&gt;
                 from ./header_check.cc:4:&lt;br/&gt;
/afs/acr/users/acm/mongo.temp.install/include/mongo/client/../util/../util/../db/../util/../db/concurrency.h: In member function &apos;bool mongo::MongoMutex::_checkWriteLockAlready()&apos;:&lt;br/&gt;
/afs/acr/users/acm/mongo.temp.install/include/mongo/client/../util/../util/../db/../util/../db/concurrency.h:115: error: call of overloaded &apos;msgasserted(int, std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt;)&apos; is ambiguous&lt;br/&gt;
/afs/acr/users/acm/mongo.temp.install/include/mongo/bson/bson.h:66: note: candidates are: void mongo::msgasserted(int, const std::string&amp;amp;)&lt;br/&gt;
/afs/acr/users/acm/mongo.temp.install/include/mongo/client/../util/assert_util.h:173: note:                 void mongo::msgasserted(int, std::string)&lt;/p&gt;</description>
                <environment>All</environment>
        <key id="12214">SERVER-1273</key>
            <summary>Can&apos;t include bson/bson.h and client/connpool.h in same file due to msgasserted conflict</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="milkie@mongodb.com">Eric Milkie</assignee>
                                    <reporter username="andrew.morrow@mongodb.com">Andrew Morrow</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jun 2010 14:27:02 +0000</created>
                <updated>Tue, 12 Jul 2016 00:27:13 +0000</updated>
                            <resolved>Tue, 20 Dec 2011 16:25:38 +0000</resolved>
                                                    <fixVersion>2.1.0</fixVersion>
                                    <component>Internal Client</component>
                                        <votes>1</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="79376" author="milkie" created="Thu, 12 Jan 2012 17:33:30 +0000"  >&lt;p&gt;Hi Michael,&lt;br/&gt;
We haven&apos;t released the next version yet.  When we release the next version, the C++ driver tarball will be updated with my commit seen above.&lt;br/&gt;
You have the option of using the latest yet-unreleased nightly build of the server for C++ driver use, to take advantage of the new headers without waiting for the next release.&lt;/p&gt;</comment>
                            <comment id="79337" author="mwieher" created="Thu, 12 Jan 2012 14:43:45 +0000"  >&lt;p&gt;The github link shows changes that are not reflected on the driver download.&lt;/p&gt;

&lt;p&gt;Notably, the msgasserted function does not exist, that is, the updates to uasserted are on the package downloaded via &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.mongodb.org/pages/viewpage.action?pageId=21269361&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.mongodb.org/pages/viewpage.action?pageId=21269361&lt;/a&gt; #C++ language center&lt;/p&gt;

&lt;p&gt;however, the changes to msgasserted were not pushed to the package linked on the website, and I believe a function which relied/relies upon the current (ambiguous) msgasserted signature needs to be re-worked once the change is actually pushed.&lt;/p&gt;
</comment>
                            <comment id="74736" author="milkie" created="Tue, 20 Dec 2011 16:25:38 +0000"  >&lt;p&gt;Fixed headers will be in the next release!&lt;/p&gt;</comment>
                            <comment id="74723" author="auto" created="Tue, 20 Dec 2011 15:56:02 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;milkie&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1273&quot; title=&quot;Can&amp;#39;t include bson/bson.h and client/connpool.h in same file due to msgasserted conflict&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1273&quot;&gt;&lt;del&gt;SERVER-1273&lt;/del&gt;&lt;/a&gt; fix name collisions between bson.h and assert_util.h&lt;/p&gt;

&lt;p&gt;Both header files define certain assert functions inline.  If you are using the C++ driver,&lt;br/&gt;
these function definitions conflict, depending on what order you include the files.&lt;br/&gt;
To fix this, I changed the function definitions in assert_util.h to declarations, and also&lt;br/&gt;
tweaked the function signatures so that they would match between bson.h and assert_util.h.&lt;br/&gt;
I couldn&apos;t make the bson.h functions declarations because there is no associated bson.cpp&lt;br/&gt;
translation unit, so I had to change the assert_utils.h functions instead.&lt;br/&gt;
Removing the inlinedness from the functions is okay because they end up calling functions&lt;br/&gt;
that are explicitly marked NOINLINE anyway.  Assertions are exceptional and the cost of&lt;br/&gt;
one added function call is not significant.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b4c100b0083db46f7915dceaf6ce4dd86d8497c6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b4c100b0083db46f7915dceaf6ce4dd86d8497c6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="24487" author="acm" created="Wed, 23 Feb 2011 00:34:26 +0000"  >&lt;p&gt;I believe you, but it sort of misses the point. Client facing include files should never have this sort of order dependency. Every header in the set of client facing headers should be&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;complete: includes all headers needed to compile the header in isolation&lt;/li&gt;
	&lt;li&gt;idempotent: compiles correctly even if already included&lt;/li&gt;
	&lt;li&gt;context independent: compiles correctly no matter which other client headers have been previously included&lt;/li&gt;
	&lt;li&gt;hygenic: minimal injections to the global namespace, doesn&apos;t leak macros lacking a package prefix, etc.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Basically, the first three criteria can be validated by the following tests:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;For any client facing header X.h, I should be able to make a file X.c which includes &apos;#include X.h&apos; twice, with no other content, and have that compile cleanly.&lt;/li&gt;
	&lt;li&gt;For the complete set of client facing headers, I should be able to take any subset and include them in any order to one .C file, and have that  compile cleanly.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The mongo C++ driver headers currently don&apos;t pass these sorts of tests.&lt;/p&gt;</comment>
                            <comment id="24306" author="scotthernandez" created="Sun, 20 Feb 2011 00:43:09 +0000"  >&lt;p&gt;You can work around this issue by including more stuff via db/jsobj.h, instead of just bson.h.&lt;/p&gt;</comment>
                            <comment id="23334" author="acm" created="Tue, 8 Feb 2011 02:14:35 +0000"  >&lt;p&gt;Recently, this has become an issue for me as well, using mongo 1.6.3&lt;/p&gt;</comment>
                            <comment id="17703" author="ldiduck" created="Thu, 2 Sep 2010 15:34:06 +0000"  >&lt;p&gt;It did break things for me&lt;/p&gt;</comment>
                            <comment id="16280" author="acm" created="Thu, 29 Jul 2010 15:14:03 +0000"  >
&lt;p&gt;This issue isn&apos;t personally blocking anything for me, since I don&apos;t happen to have a need to include both of these files in the same translation unit right now. However, it is almost certainly going to break things for &lt;em&gt;some&lt;/em&gt; user of the C++ driver.&lt;/p&gt;

&lt;p&gt;I&apos;d looked at fixing this myself but the assertion macros are somewhat subtle and I don&apos;t want to break anything. It feels like a refactoring best left to the experts. But I&apos;d still hope to see this fixed in 1.5 if possible.&lt;/p&gt;

&lt;p&gt;FWIW, the error message has changed somewhat:&lt;/p&gt;


&lt;p&gt;#include &amp;lt;mongo/bson/bson.h&amp;gt;&lt;br/&gt;
#include &amp;lt;mongo/client/connpool.h&amp;gt;&lt;/p&gt;

&lt;p&gt;gets you:&lt;/p&gt;

&lt;p&gt;In file included from /home/acm/tmp/mongo-tmp-install/include/mongo/client/../util/../util/../db/../util/optime.h:20,&lt;br/&gt;
                 from /home/acm/tmp/mongo-tmp-install/include/mongo/client/../util/../util/../db/jsobj.h:33,&lt;br/&gt;
                 from /home/acm/tmp/mongo-tmp-install/include/mongo/client/../util/../util/sock.h:25,&lt;br/&gt;
                 from /home/acm/tmp/mongo-tmp-install/include/mongo/client/../util/message.h:20,&lt;br/&gt;
                 from /home/acm/tmp/mongo-tmp-install/include/mongo/client/dbclient.h:21,&lt;br/&gt;
                 from /home/acm/tmp/mongo-tmp-install/include/mongo/client/connpool.h:21,&lt;br/&gt;
                 from xxx.cc:&lt;br/&gt;
/home/acm/tmp/mongo-tmp-install/include/mongo/client/../util/../util/../db/../util/../db/concurrency.h: In member function &apos;bool mongo::MongoMutex::_checkWriteLockAlready()&apos;:&lt;br/&gt;
/home/acm/tmp/mongo-tmp-install/include/mongo/client/../util/../util/../db/../util/../db/concurrency.h:113: error: call of overloaded &apos;msgasserted(int, std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;, std::allocator&amp;lt;char&amp;gt; &amp;gt;)&apos; is ambiguous&lt;br/&gt;
/home/acm/tmp/mongo-tmp-install/include/mongo/bson/bson.h:94: note: candidates are: void mongo::msgasserted(int, const std::string&amp;amp;)&lt;br/&gt;
/home/acm/tmp/mongo-tmp-install/include/mongo/client/../util/assert_util.h:176: note:                 void mongo::msgasserted(int, std::string)&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 2 Sep 2010 15:34:06 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 5 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 5 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrew.morrow@mongodb.com</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>ldiduck</customfieldvalue>
            <customfieldvalue>mwieher</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpl0n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrgbtj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8824</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrktr3:</customfieldvalue>

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