<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:18:37 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-3634] Windows thread handles are leaked</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3634</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The thread functions defined in common-thread-private.h give a platform agnostic thread and mutex API.&lt;/p&gt;

&lt;p&gt;On Windows, &lt;tt&gt;bson_thread_create&lt;/tt&gt; wraps CreateThread. This creates a new thread handle. And &lt;tt&gt;bson_thread_join&lt;/tt&gt; wraps WaitForSingleObject to wait on that thread handle, but it does not close the thread handle after waiting.&lt;/p&gt;

&lt;p&gt;The documentation for &lt;a href=&quot;https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CreateThread&lt;/a&gt; states:&lt;/p&gt;

&lt;p&gt;&amp;gt; The thread object remains in the system until the thread has terminated and all handles to it have been closed through a call to CloseHandle.&lt;/p&gt;

&lt;p&gt;The leak can be observed this with a simple example program that just creates and destroys a &lt;tt&gt;mongoc_client_pool_t&lt;/tt&gt; repeatedly (which creates one monitoring thread and joins it repeatedly). The example is attached as handle-leak.c. A screenshot of process explorer showing a large number of open handles is also attached.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1329017">CDRIVER-3634</key>
            <summary>Windows thread handles are leaked</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="13201">Fixed</resolution>
                                        <assignee username="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="kevin.albertson@mongodb.com">Kevin Albertson</reporter>
                        <labels>
                            <label>platform-problems</label>
                    </labels>
                <created>Sat, 25 Apr 2020 14:03:20 +0000</created>
                <updated>Sat, 28 Oct 2023 11:28:47 +0000</updated>
                            <resolved>Thu, 7 May 2020 01:07:36 +0000</resolved>
                                                    <fixVersion>1.17.0-beta2</fixVersion>
                    <fixVersion>1.17.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3106175" author="xgen-internal-githook" created="Mon, 25 May 2020 21:14:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;email&apos;: &apos;kevin.albertson@10gen.com&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3635&quot; title=&quot;Thread creation on Windows should use _beginthreadex&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3635&quot;&gt;&lt;del&gt;CDRIVER-3635&lt;/del&gt;&lt;/a&gt; use _beginthreadex, not CreateThread&lt;/p&gt;

&lt;p&gt;Use correct calling convention in thread functions.&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3634&quot; title=&quot;Windows thread handles are leaked&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3634&quot;&gt;&lt;del&gt;CDRIVER-3634&lt;/del&gt;&lt;/a&gt; close thread handles after joining.&lt;br/&gt;
Branch: r1.17&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/d47399cb8a885c538f5446b71ace9655e215454f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/d47399cb8a885c538f5446b71ace9655e215454f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3073047" author="xgen-internal-githook" created="Thu, 7 May 2020 01:06:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;email&apos;: &apos;kevin.albertson@10gen.com&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3635&quot; title=&quot;Thread creation on Windows should use _beginthreadex&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3635&quot;&gt;&lt;del&gt;CDRIVER-3635&lt;/del&gt;&lt;/a&gt; use _beginthreadex, not CreateThread&lt;/p&gt;

&lt;p&gt;Use correct calling convention in thread functions.&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3634&quot; title=&quot;Windows thread handles are leaked&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3634&quot;&gt;&lt;del&gt;CDRIVER-3634&lt;/del&gt;&lt;/a&gt; close thread handles after joining.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/bedfc0157f2d0a88c463086915426546b0f633b3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/bedfc0157f2d0a88c463086915426546b0f633b3&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="257521" name="handle-leak.c" size="853" author="kevin.albertson@mongodb.com" created="Sat, 25 Apr 2020 14:04:25 +0000"/>
                            <attachment id="257522" name="handle-leak.png" size="29099" author="kevin.albertson@mongodb.com" created="Sat, 25 Apr 2020 14:04:25 +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|hx5307:</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>