Skip to content

Commit 7ac72c2

Browse files
committed
Upgrade deps of servers
1 parent ae93a34 commit 7ac72c2

File tree

2 files changed

+55
-54
lines changed

2 files changed

+55
-54
lines changed

Diff for: pom.xml

+19-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.springframework.boot</groupId>
99
<artifactId>spring-boot-starter-parent</artifactId>
10-
<version>3.1.4</version>
10+
<version>3.2.0</version>
1111
</parent>
1212

1313
<groupId>im.turms</groupId>
@@ -31,44 +31,44 @@
3131
<revision>0.10.0-SNAPSHOT</revision>
3232

3333
<!-- Runtime Deps -->
34-
<awssdk.version>2.21.0</awssdk.version>
34+
<awssdk.version>2.21.40</awssdk.version>
3535
<blockhound.version>1.0.8.RELEASE</blockhound.version>
3636
<disruptor.version>4.0.0</disruptor.version>
3737
<eclipse-collections.version>11.1.0</eclipse-collections.version>
38-
<graalvm.version>23.0.1</graalvm.version>
39-
<icu4j.version>73.2</icu4j.version>
40-
<jctools-core.version>4.0.1</jctools-core.version>
41-
<log4j.version>2.20.0</log4j.version>
42-
<protobuf.version>3.24.4</protobuf.version>
43-
<swagger.version>2.2.16</swagger.version>
44-
<swagger-ui.version>5.7.2</swagger-ui.version>
38+
<graalvm.version>23.0.2</graalvm.version>
39+
<icu4j.version>74.1</icu4j.version>
40+
<jctools-core.version>4.0.2</jctools-core.version>
41+
<log4j.version>2.22.0</log4j.version>
42+
<protobuf.version>3.25.1</protobuf.version>
43+
<swagger.version>2.2.19</swagger.version>
44+
<swagger-ui.version>5.10.3</swagger-ui.version>
4545

4646
<!-- Runtime Deps for Testing -->
4747
<jmh.version>1.37</jmh.version>
48-
<testcontainers.version>1.19.1</testcontainers.version>
48+
<testcontainers.version>1.19.3</testcontainers.version>
4949

5050
<!-- Maven plugins -->
51-
<checkstyle.version>10.12.4</checkstyle.version>
51+
<checkstyle.version>10.12.6</checkstyle.version>
5252
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
53-
<git-commit-id-maven-plugin.version>6.0.0</git-commit-id-maven-plugin.version>
54-
<maven-checkstyle-plugin.version>3.3.0</maven-checkstyle-plugin.version>
53+
<git-commit-id-maven-plugin.version>7.0.0</git-commit-id-maven-plugin.version>
54+
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
5555
<maven.compiler.source>${java.version}</maven.compiler.source>
5656
<maven.compiler.target>${java.version}</maven.compiler.target>
5757
<!-- spring-boot-starter-parent sets it to "<maven.compiler.release>${java.version}</maven.compiler.release>",
5858
so we set it to empty to not compile with "release" to use Java internal APIs -->
5959
<maven.compiler.release/>
6060
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
61-
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
62-
<maven-failsafe-plugin.version>3.1.2</maven-failsafe-plugin.version>
61+
<maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
62+
<maven-failsafe-plugin.version>3.2.2</maven-failsafe-plugin.version>
6363
<!-- TODO: spring-boot-dependencies-3.1.4 use 3.4.1, which doesn't
6464
support Java 21, we can remove this properties when it upgrade-->
6565
<maven-shade-plugin.version>3.5.1</maven-shade-plugin.version>
6666
<os-maven-plugin.version>1.7.1</os-maven-plugin.version>
6767
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
68-
<spotbugs-maven-plugin.version>4.7.3.5</spotbugs-maven-plugin.version>
69-
<spotless-maven-plugin.version>2.39.0</spotless-maven-plugin.version>
70-
<spotless-maven-plugin.eclipse.version>4.29</spotless-maven-plugin.eclipse.version>
71-
<spring-boot-thin-layout.version>1.0.30.RELEASE</spring-boot-thin-layout.version>
68+
<spotbugs-maven-plugin.version>4.8.1.0</spotbugs-maven-plugin.version>
69+
<spotless-maven-plugin.version>2.41.1</spotless-maven-plugin.version>
70+
<spotless-maven-plugin.eclipse.version>4.30</spotless-maven-plugin.eclipse.version>
71+
<spring-boot-thin-layout.version>1.0.31.RELEASE</spring-boot-thin-layout.version>
7272

7373
<!-- Configs -->
7474
<skipITs>false</skipITs>

Diff for: turms-server-common/src/main/java/com/mongodb/internal/operation/TurmsFindOperation.java

+36-35
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737

3838
import static com.mongodb.assertions.Assertions.notNull;
3939
import static com.mongodb.internal.async.ErrorHandlingResultCallback.errorHandlingCallback;
40-
import static com.mongodb.internal.operation.CommandOperationHelper.createReadCommandAndExecuteAsync;
40+
import static com.mongodb.internal.operation.AsyncOperationHelper.createReadCommandAndExecuteAsync;
41+
import static com.mongodb.internal.operation.AsyncOperationHelper.decorateReadWithRetriesAsync;
42+
import static com.mongodb.internal.operation.AsyncOperationHelper.withAsyncSourceAndConnection;
4143
import static com.mongodb.internal.operation.CommandOperationHelper.initialRetryState;
42-
import static com.mongodb.internal.operation.CommandOperationHelper.logRetryExecute;
4344
import static com.mongodb.internal.operation.ExplainHelper.asExplainCommand;
4445
import static com.mongodb.internal.operation.OperationHelper.LOGGER;
4546
import static com.mongodb.internal.operation.OperationHelper.canRetryRead;
4647
import static com.mongodb.internal.operation.OperationHelper.cursorDocumentToQueryResult;
47-
import static com.mongodb.internal.operation.OperationHelper.withAsyncSourceAndConnection;
4848
import static com.mongodb.internal.operation.OperationReadConcernHelper.appendReadConcernToCommand;
4949
import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION;
5050

@@ -90,33 +90,33 @@ public void executeAsync(
9090
final SingleResultCallback<AsyncBatchCursor<T>> callback) {
9191
RetryState retryState = initialRetryState(retryReads);
9292
binding.retain();
93-
AsyncCallbackSupplier<AsyncBatchCursor<T>> asyncRead = CommandOperationHelper
94-
.<AsyncBatchCursor<T>>decorateReadWithRetries(retryState, funcCallback -> {
95-
logRetryExecute(retryState);
96-
withAsyncSourceAndConnection(binding::getReadConnectionSource,
97-
false,
98-
funcCallback,
99-
(source, connection, releasingCallback) -> {
100-
if (retryState
101-
.breakAndCompleteIfRetryAnd(
102-
() -> !canRetryRead(source.getServerDescription(),
103-
binding.getSessionContext()),
104-
releasingCallback)) {
105-
return;
106-
}
107-
final SingleResultCallback<AsyncBatchCursor<T>> wrappedCallback =
108-
exceptionTransformingCallback(releasingCallback);
109-
createReadCommandAndExecuteAsync(retryState,
110-
binding,
111-
source,
112-
namespace.getDatabaseName(),
113-
getCommandCreator(binding.getSessionContext()),
114-
CommandResultDocumentCodec.create(decoder, FIRST_BATCH),
115-
asyncTransformer(),
116-
connection,
117-
wrappedCallback);
118-
});
119-
})
93+
AsyncCallbackSupplier<AsyncBatchCursor<T>> asyncRead = decorateReadWithRetriesAsync(
94+
retryState,
95+
binding.getOperationContext(),
96+
(AsyncCallbackSupplier<AsyncBatchCursor<T>>) funcCallback -> withAsyncSourceAndConnection(
97+
binding::getReadConnectionSource,
98+
false,
99+
funcCallback,
100+
(source, connection, releasingCallback) -> {
101+
if (retryState
102+
.breakAndCompleteIfRetryAnd(
103+
() -> !canRetryRead(source.getServerDescription(),
104+
binding.getSessionContext()),
105+
releasingCallback)) {
106+
return;
107+
}
108+
SingleResultCallback<AsyncBatchCursor<T>> wrappedCallback =
109+
exceptionTransformingCallback(releasingCallback);
110+
createReadCommandAndExecuteAsync(retryState,
111+
binding,
112+
source,
113+
namespace.getDatabaseName(),
114+
getCommandCreator(binding.getSessionContext()),
115+
CommandResultDocumentCodec.create(decoder, FIRST_BATCH),
116+
asyncTransformer(),
117+
connection,
118+
wrappedCallback);
119+
}))
120120
.whenComplete(binding::release);
121121
asyncRead.get(errorHandlingCallback(callback, LOGGER));
122122
}
@@ -125,10 +125,11 @@ private static <T> SingleResultCallback<T> exceptionTransformingCallback(
125125
final SingleResultCallback<T> callback) {
126126
return (result, t) -> {
127127
if (t != null) {
128-
if (t instanceof MongoCommandException e) {
129-
MongoQueryException exception =
130-
new MongoQueryException(e.getResponse(), e.getServerAddress());
131-
callback.onResult(result, exception);
128+
if (t instanceof MongoCommandException commandException) {
129+
callback.onResult(result,
130+
new MongoQueryException(
131+
commandException.getResponse(),
132+
commandException.getServerAddress()));
132133
} else {
133134
callback.onResult(result, t);
134135
}
@@ -170,7 +171,7 @@ private CommandOperationHelper.CommandCreator getCommandCreator(
170171
};
171172
}
172173

173-
private CommandOperationHelper.CommandReadTransformerAsync<BsonDocument, AsyncBatchCursor<T>> asyncTransformer() {
174+
private AsyncOperationHelper.CommandReadTransformerAsync<BsonDocument, AsyncBatchCursor<T>> asyncTransformer() {
174175
return (result, source, connection) -> {
175176
QueryResult<T> queryResult = cursorDocumentToQueryResult(result.getDocument("cursor"),
176177
connection.getDescription()

0 commit comments

Comments
 (0)