Skip to content

Commit 3991cae

Browse files
committed
Merge branch '6.1.x'
2 parents a77895b + 580adfc commit 3991cae

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ else if (targetException instanceof Exception exception) {
280280

281281
/**
282282
* Invoke the given Kotlin coroutine suspended function.
283-
*
284283
* <p>The default implementation invokes
285284
* {@link CoroutinesUtils#invokeSuspendingFunction(Method, Object, Object...)},
286285
* but subclasses can override this method to use
@@ -292,6 +291,7 @@ protected Object invokeSuspendingFunction(Method method, Object target, Object[]
292291
return CoroutinesUtils.invokeSuspendingFunction(method, target, args);
293292
}
294293

294+
295295
/**
296296
* Inner class to avoid a hard dependency on Kotlin at runtime.
297297
*/
@@ -334,7 +334,6 @@ public static Object invokeFunction(Method method, Object target, Object[] args)
334334
Object result = function.callBy(argMap);
335335
return (result == Unit.INSTANCE ? null : result);
336336
}
337-
338337
}
339338

340339
}

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ private boolean isResponseHandled(Object[] args, ServerWebExchange exchange) {
313313
return false;
314314
}
315315

316+
316317
/**
317318
* Inner class to avoid a hard dependency on Kotlin at runtime.
318319
*/
@@ -371,7 +372,6 @@ public static Object invokeFunction(Method method, Object target, Object[] args,
371372
return (result == Unit.INSTANCE ? null : result);
372373
}
373374
}
374-
375375
}
376376

377377
}

spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -248,30 +248,31 @@ private void limitExceeded(String reason) {
248248

249249
@Override
250250
public void close(CloseStatus status) throws IOException {
251-
this.closeLock.lock();
252-
try {
253-
if (this.closeInProgress) {
254-
return;
255-
}
256-
if (!CloseStatus.SESSION_NOT_RELIABLE.equals(status)) {
257-
try {
258-
checkSessionLimits();
259-
}
260-
catch (SessionLimitExceededException ex) {
261-
// Ignore
251+
if (this.closeLock.tryLock()) {
252+
try {
253+
if (this.closeInProgress) {
254+
return;
262255
}
263-
if (this.limitExceeded) {
264-
if (logger.isDebugEnabled()) {
265-
logger.debug("Changing close status " + status + " to SESSION_NOT_RELIABLE.");
256+
if (!CloseStatus.SESSION_NOT_RELIABLE.equals(status)) {
257+
try {
258+
checkSessionLimits();
259+
}
260+
catch (SessionLimitExceededException ex) {
261+
// Ignore
262+
}
263+
if (this.limitExceeded) {
264+
if (logger.isDebugEnabled()) {
265+
logger.debug("Changing close status " + status + " to SESSION_NOT_RELIABLE.");
266+
}
267+
status = CloseStatus.SESSION_NOT_RELIABLE;
266268
}
267-
status = CloseStatus.SESSION_NOT_RELIABLE;
268269
}
270+
this.closeInProgress = true;
271+
super.close(status);
272+
}
273+
finally {
274+
this.closeLock.unlock();
269275
}
270-
this.closeInProgress = true;
271-
super.close(status);
272-
}
273-
finally {
274-
this.closeLock.unlock();
275276
}
276277
}
277278

0 commit comments

Comments
 (0)