<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:47 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>[JAVA-660] Concurrency issue can cause corrupted messages to be sent to the server</title>
                <link>https://jira.mongodb.org/browse/JAVA-660</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;The 2.9.0 version of the driver introduced a regression which can cause corrupted wire protocol messages to be sent to the server.  &lt;/p&gt;

&lt;p&gt;In practice, the impact of the bug is mitigated by these circumstances:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Occurs when connected to a replica set or multiple mongos using the new HA support for mongos (but not a single mongos or a standalone).&lt;/li&gt;
	&lt;li&gt;It&apos;s triggered only if the driver gets an IOException while performing a normal query (not commands) and attempts to retry the query.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;If both of these occur, it becomes likely that the driver will send corrupted messages to the server, and keep sending them until the application is restarted.&lt;/p&gt;

&lt;p&gt;The affect of sending corrupted messages to the server is undefined.  In some cases, the server will assert and send back an error.  In others, it will crash.  And in others, it will add corrupt documents to the database.  Using --objcheck can mitigate the latter case, but not fully.&lt;/p&gt;</description>
                <environment>Linux 3.0.0-12-server x86_64, 1.6.0_26-b03</environment>
        <key id="52036">JAVA-660</key>
            <summary>Concurrency issue can cause corrupted messages to be sent to the server</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.mongodb.org/images/icons/priorities/blocker.svg">Blocker - P1</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="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="ghik">Roman Janusz</reporter>
                        <labels>
                            <label>driver</label>
                    </labels>
                <created>Tue, 2 Oct 2012 13:57:54 +0000</created>
                <updated>Fri, 11 Jan 2013 03:57:12 +0000</updated>
                            <resolved>Mon, 22 Oct 2012 04:51:21 +0000</resolved>
                                    <version>2.9.0</version>
                    <version>2.9.1</version>
                                    <fixVersion>2.9.2</fixVersion>
                    <fixVersion>2.10.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>13</watches>
                                                                                                                <comments>
                            <comment id="236832" author="jeff.yemin" created="Fri, 11 Jan 2013 03:51:53 +0000"  >&lt;p&gt;An easy way to demonstrate that the bug only manifests when connected to a list of servers (replica set or mongos)  If you use a URI with a single host, like &quot;mongodb://localhost&quot;, the bug does not manifest.  To actually demonstrate the bug, you have to use a multithreaded program.&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;import com.mongodb.DBCollection;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;import com.mongodb.Mongo;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;import com.mongodb.MongoURI;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;import java.net.UnknownHostException;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;public class JAVA660Test {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    public static void main(String[] args) throws UnknownHostException, InterruptedException {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        Mongo mongo = new Mongo(new MongoURI(args[0]));&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        DBCollection coll = mongo.getDB(&quot;JAVA660&quot;).getCollection(&quot;test&quot;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        while (true) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            try {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                // kill mongod at any point to generate exceptions, then restart mongod&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                coll.findOne();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            } catch (Exception e) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                e.printStackTrace();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            Thread.sleep(10);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="234360" author="auto" created="Tue, 8 Jan 2013 19:13:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-20T06:02:18Z&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-660&quot; title=&quot;Concurrency issue can cause corrupted messages to be sent to the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-660&quot;&gt;&lt;del&gt;JAVA-660&lt;/del&gt;&lt;/a&gt;: Took call to OutMessage.doneWithMessage out of the recursively-called method, to avoid having it called more than once.  Protected OutMessage by setting the buffer to null and checking for null everywhere it&apos;s used.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/0f67736ad72000f3f779c3623852fc8af249de24&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/0f67736ad72000f3f779c3623852fc8af249de24&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="234343" author="auto" created="Tue, 8 Jan 2013 19:07:11 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-20T06:02:18Z&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-660&quot; title=&quot;Concurrency issue can cause corrupted messages to be sent to the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-660&quot;&gt;&lt;del&gt;JAVA-660&lt;/del&gt;&lt;/a&gt;: Took call to OutMessage.doneWithMessage out of the recursively-called method, to avoid having it called more than once.  Protected OutMessage by setting the buffer to null and checking for null everywhere it&apos;s used.&lt;br/&gt;
Branch: 2.10.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/0f67736ad72000f3f779c3623852fc8af249de24&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/0f67736ad72000f3f779c3623852fc8af249de24&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="178445" author="jeff.yemin" created="Tue, 23 Oct 2012 22:52:11 +0000"  >&lt;p&gt;FYI, 2.9.2 is released with the fix for this issue.&lt;/p&gt;</comment>
                            <comment id="178111" author="jeff.yemin" created="Tue, 23 Oct 2012 14:03:30 +0000"  >&lt;p&gt;Confirmed. It&apos;s a regression introduced in 2.9.0.&lt;/p&gt;</comment>
                            <comment id="178106" author="christopher.price@mtvn.com" created="Tue, 23 Oct 2012 13:40:54 +0000"  >&lt;p&gt;Could you please confirm that this issue was introduced in the 2.9 driver and does not exist in 2.8?  We are rolling out the 2.8 driver today.  Thanks.&lt;/p&gt;</comment>
                            <comment id="177627" author="auto" created="Mon, 22 Oct 2012 05:11:35 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-21T22:11:24-07:00&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-660&quot; title=&quot;Concurrency issue can cause corrupted messages to be sent to the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-660&quot;&gt;&lt;del&gt;JAVA-660&lt;/del&gt;&lt;/a&gt;: Added unit test for OutMessage defensive coding&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/e9c608e061dbe13c69b46577a3127e424b4258b0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/e9c608e061dbe13c69b46577a3127e424b4258b0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="177623" author="auto" created="Mon, 22 Oct 2012 04:50:18 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-19T23:02:18-07:00&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-660&quot; title=&quot;Concurrency issue can cause corrupted messages to be sent to the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-660&quot;&gt;&lt;del&gt;JAVA-660&lt;/del&gt;&lt;/a&gt;: Took call to OutMessage.doneWithMessage out of the recursively-called method, to avoid having it called more than once.  Protected OutMessage by setting the buffer to null and checking for null everywhere it&apos;s used.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/73c2615b042ab5ba2fecb380ff0edd4b866cdfa1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/73c2615b042ab5ba2fecb380ff0edd4b866cdfa1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="177470" author="auto" created="Sat, 20 Oct 2012 23:32:56 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-19T23:02:18-07:00&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-660&quot; title=&quot;Concurrency issue can cause corrupted messages to be sent to the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-660&quot;&gt;&lt;del&gt;JAVA-660&lt;/del&gt;&lt;/a&gt;: Took call to OutMessage.doneWithMessage out of the recursively-called method, to avoid having it called more than once.  Protected OutMessage by setting the buffer to null and checking for null everywhere it&apos;s used.&lt;br/&gt;
Branch: release-2.9.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/0f67736ad72000f3f779c3623852fc8af249de24&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/0f67736ad72000f3f779c3623852fc8af249de24&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="177410" author="jeff.yemin" created="Sat, 20 Oct 2012 05:25:29 +0000"  >&lt;p&gt;I am able to reproduce this bug in this way:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Use a replica set&lt;/li&gt;
	&lt;li&gt;Use ReadPreference.primary&lt;/li&gt;
	&lt;li&gt;Kill the primary&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;This causes DBTCPConnector.call(...) to call itself recursively, and call OutMessage.doneWithMessage multiple times (from finally clause) as a result.  It&apos;s always been this way.  But the bug was introduced in 2.9.0 when I removed the setting of _buffer to null in OutMessage.doneWithMessage, not realizing that it could be called more than once.  This code path will cause buffers to be shared between multiple threads, which will lead to corrupt messages being sent to the server.&lt;/p&gt;</comment>
                            <comment id="170695" author="jeff.yemin" created="Wed, 3 Oct 2012 03:31:27 +0000"  >&lt;p&gt;This is going to be difficult to find without some way to reproduce the crash (it would be a lot easier if the server reported an error instead of crashed).  Is there any way you can correlate the server crash with a specific event in the application log files?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="51469">SERVER-7163</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </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="10012"><![CDATA[Major 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|hrj9mf:</customfieldvalue>

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