<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39: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>[CSHARP-1488] Properly implement Flush/FlushAsync for GridFS streams</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1488</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;The abstract Stream class defines Flush and FlushAsync methods that must be implemented by subclasses of Stream.&lt;/p&gt;

&lt;p&gt;The normal semantics of Flush and FlushAsync are that any pending data is written to the underlying store immediately. The usual intent when calling Flush is to prevent any data loss in the event the process is aborted.&lt;/p&gt;

&lt;p&gt;Clearly we should throw a NotSupportedException when Flush is called on a GridFS download stream (because download streams are read-only and Flush is a method for writable streams). But what should we do when Flush is called on a GridFS upload stream?&lt;/p&gt;

&lt;p&gt;In the case of GridFS we can&apos;t actually write pending data to the underlying data store (i.e. the GridFS bucket) because GridFS data is written in chunks and we don&apos;t have the data for the rest of the chunk yet. Furthermore, a GridFS file isn&apos;t actually considered to exist until it is 100% uploaded and the files collection metadata document is written, so even if we decided to flush a partial chunk to the chunks collection (and overwrite it later when the rest of the data for the chunk becomes available), it sill wouldn&apos;t serve the purpose of preventing data loss.&lt;/p&gt;

&lt;p&gt;The two options for implementing Flush on an upload stream are:&lt;/p&gt;

&lt;p&gt;1. Throw a NotSupportedException (because Flush is not supported)&lt;br/&gt;
2. Implement Flush as a no-op&lt;/p&gt;

&lt;p&gt;The first is arguably more correct, but runs the risk of breaking any code (some of which might be out of the user&apos;s control) that calls Flush assuming that it is supported.&lt;/p&gt;

&lt;p&gt;The second is more compatible with existing code because it simply does nothing instead of throwing an exception, at the expense of providing the false illusion that the Flush was actually done.&lt;/p&gt;

&lt;p&gt;Our current thinking is that compatibility with existing code that might call Flush is more important than accurately reporting that Flush isn&apos;t actually supported.&lt;/p&gt;

&lt;p&gt;So Flush and FlushAsync for GridFS upload streams will be implemented as no-ops (a download stream will still throw a NotSupportedException).&lt;/p&gt;</description>
                <environment></environment>
        <key id="241465">CSHARP-1488</key>
            <summary>Properly implement Flush/FlushAsync for GridFS streams</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="9">Done</resolution>
                                        <assignee username="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="robert@mongodb.com">Robert Stam</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Nov 2015 18:40:08 +0000</created>
                <updated>Sat, 22 Oct 2022 13:06:37 +0000</updated>
                            <resolved>Wed, 2 Dec 2015 18:12:26 +0000</resolved>
                                    <version>2.1.1</version>
                                    <fixVersion>2.2</fixVersion>
                                    <component>GridFS</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1103431" author="xgen-internal-githook" created="Wed, 2 Dec 2015 18:12:01 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rstam&apos;, u&apos;name&apos;: u&apos;rstam&apos;, u&apos;email&apos;: u&apos;robert@robertstam.org&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1488&quot; title=&quot;Properly implement Flush/FlushAsync for GridFS streams&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1488&quot;&gt;&lt;del&gt;CSHARP-1488&lt;/del&gt;&lt;/a&gt;: Properly implement Flush and FlushAsync for GridFS streams.&lt;br/&gt;
Branch: v2.1.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/78a2272f2ba51216726f3449a1018229d611f59d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/78a2272f2ba51216726f3449a1018229d611f59d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1103226" author="xgen-internal-githook" created="Wed, 2 Dec 2015 15:20:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rstam&apos;, u&apos;name&apos;: u&apos;rstam&apos;, u&apos;email&apos;: u&apos;robert@robertstam.org&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1488&quot; title=&quot;Properly implement Flush/FlushAsync for GridFS streams&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1488&quot;&gt;&lt;del&gt;CSHARP-1488&lt;/del&gt;&lt;/a&gt;: Properly implement Flush and FlushAsync for GridFS streams.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/f5c299d7630c3211cc3d8869ea6f95fe2c0aa20f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/f5c299d7630c3211cc3d8869ea6f95fe2c0aa20f&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2164706">CSHARP-4377</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10011"><![CDATA[Minor Change]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsehdz:</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="802">C# Sprint 29</customfieldvalue>

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