Merge branch '7.0.x'

This commit is contained in:
Juergen Hoeller
2026-03-21 12:45:25 +01:00
7 changed files with 13 additions and 7 deletions
@@ -29,7 +29,7 @@ public class ExceptionController {
// tag::narrow[]
@ExceptionHandler({FileSystemException.class, RemoteException.class})
public ResponseEntity<String> handleIoException(IOException ex) {
public ResponseEntity<String> handleIOException(IOException ex) {
return ResponseEntity.internalServerError().body(ex.getMessage());
}
// end::narrow[]
@@ -27,7 +27,7 @@ class ExceptionController {
// tag::narrow[]
@ExceptionHandler(FileSystemException::class, RemoteException::class)
fun handleIoException(ex: IOException): ResponseEntity<String> {
fun handleIOException(ex: IOException): ResponseEntity<String> {
return ResponseEntity.internalServerError().body(ex.message)
}
// end::narrow[]
@@ -209,7 +209,7 @@
<value>1205,3572</value>
</property>
<property name="deadlockLoserCodes">
<value>1213</value>
<value>149,1213</value>
</property>
</bean>
@@ -735,14 +735,20 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
long receiveTimeout = getReceiveTimeout();
long waitStartTime = System.currentTimeMillis();
int waitCount = 0;
boolean interrupted = false;
while (this.activeInvokerCount > 0) {
if (waitCount > 0 && !isAcceptMessagesWhileStopping() &&
System.currentTimeMillis() - waitStartTime >= receiveTimeout) {
// Unexpectedly some invokers are still active after the receive timeout period
// -> interrupt remaining receive attempts since we'd reject the messages anyway
if (interrupted) {
// Already interrupted -> not worth waiting any longer...
break;
}
for (AsyncMessageListenerInvoker scheduledInvoker : this.scheduledInvokers) {
scheduledInvoker.interruptIfNecessary();
}
interrupted = true;
}
if (logger.isDebugEnabled()) {
logger.debug("Still waiting for shutdown of " + this.activeInvokerCount +
@@ -149,7 +149,7 @@ class RestTemplateObservationTests {
}
@Test
void executeWithIoExceptionAddsUnknownOutcome() throws Exception {
void executeWithIOExceptionAddsUnknownOutcome() throws Exception {
String url = "https://example.org/resource";
mockSentRequest(GET, url);
given(request.execute()).willThrow(new IOException("Socket failure"));
@@ -172,7 +172,7 @@ class ExceptionHandlerExceptionResolverTests {
@Test
void resolveNoExceptionHandlerForException() throws NoSuchMethodException {
Exception npe = new NullPointerException();
HandlerMethod handlerMethod = new HandlerMethod(new IoExceptionController(), "handle");
HandlerMethod handlerMethod = new HandlerMethod(new IOExceptionController(), "handle");
this.resolver.afterPropertiesSet();
ModelAndView mav = this.resolver.resolveException(this.request, this.response, handlerMethod, npe);
@@ -540,7 +540,7 @@ class ExceptionHandlerExceptionResolverTests {
@Controller
static class IoExceptionController {
static class IOExceptionController {
public void handle() {}
@@ -240,7 +240,7 @@ class SockJsSessionTests extends AbstractSockJsSessionTests<TestSockJsSession> {
}
@Test
void writeFrameIoException() throws Exception {
void writeFrameIOException() throws Exception {
this.session.setExceptionOnWrite(new IOException());
this.session.delegateConnectionEstablished();