Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public ByteBuf asReadOnly() {

@Override
public ByteBuf duplicate() {
return new NettyByteBuf(proxied.retainedDuplicate(), isWriting);
return new NettyByteBuf(proxied.duplicate().retain(), isWriting);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ private void readAsync(final int numBytes, final AsyncCompletionHandler<ByteBuf>
composite.addComponent(next);
iter.remove();
} else {
composite.addComponent(next.readRetainedSlice(bytesNeededFromCurrentBuffer));
next.retain();
composite.addComponent(next.readSlice(bytesNeededFromCurrentBuffer));
}
composite.writerIndex(composite.writerIndex() + bytesNeededFromCurrentBuffer);
bytesNeeded -= bytesNeededFromCurrentBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import com.mongodb.connection.SocketSettings
import com.mongodb.internal.connection.netty.NettyStreamFactory
import org.bson.BsonDocument
import org.bson.BsonInt32
import spock.lang.Ignore
import spock.lang.Specification

import java.util.concurrent.CountDownLatch
Expand Down Expand Up @@ -57,7 +56,6 @@ class CommandHelperSpecification extends Specification {
connection?.close()
}

@Ignore("JAVA-5982")
def 'should execute command asynchronously'() {
when:
BsonDocument receivedDocument = null
Expand All @@ -84,5 +82,4 @@ class CommandHelperSpecification extends Specification {
!receivedDocument
receivedException instanceof MongoCommandException
}

}