Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
96d0c6b
Remove assertion for verbose result (#1835)
vbabanin Dec 3, 2025
69a3c1d
evergreen git clone depth is 1 (#1851)
strogiyotec Dec 5, 2025
5cb23ba
Updated specifications submodule to latest
rozza Dec 15, 2025
07a7357
Fixes JAVA-6023, align log level to warning from error when removing …
nhachicha Dec 18, 2025
7408493
Reuse ConnectionSource to avoid extra server selection. (#1813)
vbabanin Dec 18, 2025
cece170
JAVA-4320 fix server selection flaky test (#1847)
strogiyotec Jan 3, 2026
139eee0
encryptionClient uses writeConcern majority (#1858)
strogiyotec Jan 5, 2026
7200ed9
[JAVA-6043](https://jira.mongodb.org/browse/JAVA-6043) (#1859)
strogiyotec Jan 6, 2026
6fd2c95
Handle unexpected end of stream errors from KMS. (#1849)
vbabanin Jan 15, 2026
6630fe2
JAVA-5988 (#1862)
strogiyotec Jan 16, 2026
2a26a16
Version: bump 5.7.0-beta0
strogiyotec Jan 16, 2026
e2f5c40
Version: bump 5.7.0-SNAPSHOT
strogiyotec Jan 16, 2026
ad43095
improve git clone for mongo tools repository (#1866)
strogiyotec Jan 21, 2026
b922075
Bson specification testing
rozza Jan 26, 2026
475aa6c
generate sarif (#1869)
strogiyotec Jan 26, 2026
5560012
Temp disable large encryption tests on mongocryptd (#1872)
rozza Jan 29, 2026
3c51ea0
Revert NettyByteBuf.asReadOnly change (#1871)
rozza Feb 2, 2026
07b53b9
Update Netty dependency to the latest version. (#1867)
vbabanin Feb 4, 2026
2c48995
Adjust timeout handling in client-side operations to account for RTT …
vbabanin Feb 4, 2026
ff7ebe9
Update Snappy version for the latest security fixes. (#1868)
vbabanin Feb 9, 2026
b33d52b
Bson javadoc improvements (#1883)
rozza Feb 12, 2026
08be207
Merge remote-tracking branch 'upstream/main' into test
nhachicha Feb 18, 2026
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
3 changes: 3 additions & 0 deletions bson/src/main/org/bson/BinaryVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
* @since 5.3
*/
public abstract class BinaryVector {
/**
* The BinaryVector logger
*/
protected static final Logger LOGGER = Loggers.getLogger("BinaryVector");
private final DataType dataType;

Expand Down
16 changes: 14 additions & 2 deletions bson/src/main/org/bson/BsonBinary.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,14 @@ public BsonBinary(final UUID uuid, final UuidRepresentation uuidRepresentation)
}

/**
* Returns the binary as a UUID. The binary type must be 4.
* Returns the binary as a UUID.
*
* <p><strong>Note:</strong>The BsonBinary subtype must be {@link BsonBinarySubType#UUID_STANDARD}.</p>
*
* @return the uuid
* @throws BsonInvalidOperationException if BsonBinary subtype is not {@link BsonBinarySubType#UUID_STANDARD}
* @see #asUuid(UuidRepresentation)
* @see BsonBinarySubType
* @since 3.9
*/
public UUID asUuid() {
Expand Down Expand Up @@ -162,8 +167,15 @@ public BinaryVector asVector() {
/**
* Returns the binary as a UUID.
*
* @param uuidRepresentation the UUID representation
* <p><strong>Note:</strong>The BsonBinary subtype must be either {@link BsonBinarySubType#UUID_STANDARD} or
* {@link BsonBinarySubType#UUID_LEGACY}.</p>
*
* @param uuidRepresentation the UUID representation, must be {@link UuidRepresentation#STANDARD} or
* {@link UuidRepresentation#JAVA_LEGACY}
* @return the uuid
* @throws BsonInvalidOperationException if the BsonBinary subtype is incompatible with the given {@code uuidRepresentation}, or if
* the {@code uuidRepresentation} is not {@link UuidRepresentation#STANDARD} or
* {@link UuidRepresentation#JAVA_LEGACY}.
* @since 3.9
*/
public UUID asUuid(final UuidRepresentation uuidRepresentation) {
Expand Down
2 changes: 1 addition & 1 deletion bson/src/main/org/bson/BsonBinarySubType.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public enum BsonBinarySubType {
* Returns true if the given value is a UUID subtype.
*
* @param value the subtype value as a byte.
* @return true if value is a UUID subtype.
* @return true if value has a {@link #UUID_STANDARD} or {@link #UUID_LEGACY} subtype.
* @since 3.4
*/
public static boolean isUuid(final byte value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,10 @@ static Stream<Arguments> shouldChooseTimeoutMsWhenItIsLessThenConnectTimeoutMS()
);
}

@ParameterizedTest
@MethodSource
@DisplayName("should choose timeoutMS when timeoutMS is less than connectTimeoutMS")
@ParameterizedTest(name = "should choose timeoutMS when timeoutMS is less than connectTimeoutMS. "
+ "Parameters: connectTimeoutMS: {0}, timeoutMS: {1}, expected: {2}")
@MethodSource
void shouldChooseTimeoutMsWhenItIsLessThenConnectTimeoutMS(final Long connectTimeoutMS,
final Long timeoutMS,
final long expected) {
Expand All @@ -345,7 +346,7 @@ void shouldChooseTimeoutMsWhenItIsLessThenConnectTimeoutMS(final Long connectTim
0));

long calculatedTimeoutMS = timeoutContext.getConnectTimeoutMs();
assertTrue(expected - calculatedTimeoutMS <= 1);
assertTrue(expected - calculatedTimeoutMS <= 2);
}

private TimeoutContextTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,29 @@ public static <T> MongoCollection<T> collectionWithTimeout(final MongoCollection

public static <T> Mono<MongoCollection<T>> collectionWithTimeoutMono(final MongoCollection<T> collection,
@Nullable final Timeout timeout) {
return collectionWithTimeoutMono(collection, timeout, DEFAULT_TIMEOUT_MESSAGE);
}

public static <T> Mono<MongoCollection<T>> collectionWithTimeoutMono(final MongoCollection<T> collection,
@Nullable final Timeout timeout,
final String message) {
try {
return Mono.just(collectionWithTimeout(collection, timeout));
return Mono.just(collectionWithTimeout(collection, timeout, message));
} catch (MongoOperationTimeoutException e) {
return Mono.error(e);
}
}

public static <T> Mono<MongoCollection<T>> collectionWithTimeoutDeferred(final MongoCollection<T> collection,
@Nullable final Timeout timeout) {
return Mono.defer(() -> collectionWithTimeoutMono(collection, timeout));
return collectionWithTimeoutDeferred(collection, timeout, DEFAULT_TIMEOUT_MESSAGE);
}

public static <T> Mono<MongoCollection<T>> collectionWithTimeoutDeferred(final MongoCollection<T> collection,
@Nullable final Timeout timeout,
final String message) {
return Mono.defer(() -> collectionWithTimeoutMono(collection, timeout, message));
}

public static MongoDatabase databaseWithTimeout(final MongoDatabase database,
@Nullable final Timeout timeout) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
*/
public final class GridFSUploadPublisherImpl implements GridFSUploadPublisher<Void> {

private static final String TIMEOUT_ERROR_MESSAGE = "Saving chunks exceeded the timeout limit.";
private static final String TIMEOUT_ERROR_MESSAGE_CHUNKS_SAVING = "Saving chunks exceeded the timeout limit.";
private static final String TIMEOUT_ERROR_MESSAGE_UPLOAD_CANCELLATION = "Upload cancellation exceeded the timeout limit.";
private static final Document PROJECTION = new Document("_id", 1);
private static final Document FILES_INDEX = new Document("filename", 1).append("uploadDate", 1);
private static final Document CHUNKS_INDEX = new Document("files_id", 1).append("n", 1);
Expand Down Expand Up @@ -226,8 +227,8 @@ private Mono<Long> createSaveChunksMono(final AtomicBoolean terminated, @Nullabl
.append("data", data);

Publisher<InsertOneResult> insertOnePublisher = clientSession == null
? collectionWithTimeout(chunksCollection, timeout, TIMEOUT_ERROR_MESSAGE).insertOne(chunkDocument)
: collectionWithTimeout(chunksCollection, timeout, TIMEOUT_ERROR_MESSAGE)
? collectionWithTimeout(chunksCollection, timeout, TIMEOUT_ERROR_MESSAGE_CHUNKS_SAVING).insertOne(chunkDocument)
: collectionWithTimeout(chunksCollection, timeout, TIMEOUT_ERROR_MESSAGE_CHUNKS_SAVING)
.insertOne(clientSession, chunkDocument);

return Mono.from(insertOnePublisher).thenReturn(data.length());
Expand Down Expand Up @@ -270,7 +271,8 @@ private Mono<InsertOneResult> createSaveFileDataMono(final AtomicBoolean termina
}

private Mono<DeleteResult> createCancellationMono(final AtomicBoolean terminated, @Nullable final Timeout timeout) {
Mono<MongoCollection<Document>> chunksCollectionMono = collectionWithTimeoutDeferred(chunksCollection, timeout);
Mono<MongoCollection<Document>> chunksCollectionMono = collectionWithTimeoutDeferred(chunksCollection, timeout,
TIMEOUT_ERROR_MESSAGE_UPLOAD_CANCELLATION);
if (terminated.compareAndSet(false, true)) {
if (clientSession != null) {
return chunksCollectionMono.flatMap(collection -> Mono.from(collection
Expand Down
Loading