<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:01:49 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-1217] GridFS download streams should kill the cursor when closed</title>
                <link>https://jira.mongodb.org/browse/CXX-1217</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;In the implementation of &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1130&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;CXX-1130&lt;/a&gt;, the idea came up to kill the cursor being used to fetch the chunk when a download stream is closed. It isn&apos;t apparent what the most idiomatic way to do this would be; two options would be to either wrap the cursor in a unique pointer and then release it or to implement a method like `cursor::kill` specifically for these types of use cases.&lt;/p&gt;</description>
                <environment></environment>
        <key id="351595">CXX-1217</key>
            <summary>GridFS download streams should kill the cursor when closed</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="sam.rossi@mongodb.com">Samuel Rossi</assignee>
                                    <reporter username="sam.rossi@mongodb.com">Samuel Rossi</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Feb 2017 21:09:17 +0000</created>
                <updated>Fri, 17 Nov 2017 17:21:29 +0000</updated>
                            <resolved>Fri, 10 Mar 2017 18:36:18 +0000</resolved>
                                                    <fixVersion>3.2.0-rc0</fixVersion>
                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1521352" author="xgen-internal-githook" created="Fri, 10 Mar 2017 18:34:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;saghm&apos;, u&apos;name&apos;: u&apos;Saghm Rossi&apos;, u&apos;email&apos;: u&apos;saghmrossi@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1217&quot; title=&quot;GridFS download streams should kill the cursor when closed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1217&quot;&gt;&lt;del&gt;CXX-1217&lt;/del&gt;&lt;/a&gt; GridFS download streams should kill the cursor when closed&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/a29a70d72fc3beb62a77efee5d22f7ae99387b2b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/a29a70d72fc3beb62a77efee5d22f7ae99387b2b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1515740" author="sam.rossi" created="Fri, 3 Mar 2017 20:37:08 +0000"  >&lt;p&gt;Per offline discussion, the fix will be to assign the null option to the cursor field in downloader::close&lt;/p&gt;</comment>
                            <comment id="1492193" author="david.golden" created="Sat, 4 Feb 2017 02:06:04 +0000"  >&lt;p&gt;I&apos;ve retitled this about GridFS and scheduled it for this next release.  We can get to it after the current work is merged.  I don&apos;t want to extend that code review with any additional work.&lt;/p&gt;</comment>
                            <comment id="1492155" author="rassi@10gen.com" created="Fri, 3 Feb 2017 23:56:32 +0000"  >&lt;p&gt;Yep, indeed: the std::unique_ptr destructor (with the default deleter) calls delete on the managed pointer, whereas the stdx::optional destructor just invokes the destructor on the managed object.&lt;/p&gt;

&lt;p&gt;So, are we decided on scrapping the idea of adding cursor::kill(), in favor of making users use a wrapping type if they need to dynamically manage the cursor&apos;s lifetime?  If yes, is there any work to do in this ticket?&lt;/p&gt;</comment>
                            <comment id="1492114" author="david.golden" created="Fri, 3 Feb 2017 22:19:14 +0000"  >&lt;p&gt;I prefer to still with the RAII approach.  I&apos;m not entirely clear whether an optional or a  unique_ptr is better, but from what I understand, optional includes the memory allocation whereas unique_ptr does a new heap allocation, so we&apos;d prefer to use optional and assign nullopt to it to clear it (thus killing the cursor).&lt;/p&gt;</comment>
                            <comment id="1492075" author="rassi@10gen.com" created="Fri, 3 Feb 2017 21:28:49 +0000"  >&lt;p&gt;Generally, letting a mongocxx::cursor object go out of scope is the correct way to initiate a kill cursor operation against the underlying server cursor (unless the cursor is exhausted, in which case the kill cursor operation is skipped).  If you need to dynamically control the lifetime of a mongocxx::cursor object, then using a mongocxx::stdx::optional&amp;lt;mongocxx::cursor&amp;gt; object seems like the correct way to go, to me.  Do you think that providing a second way to kill a cursor satisfies additional use cases / wouldn&apos;t just be unnecessarily adding additional driver logic?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="331798">CXX-1130</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|hsvyyn:</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="1601">Perl/CXX 2017-03-24</customfieldvalue>

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