mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Merge branch '7.0.x'
This commit is contained in:
+1
-1
@@ -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[]
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
|
||||
+6
@@ -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 +
|
||||
|
||||
+1
-1
@@ -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"));
|
||||
|
||||
+2
-2
@@ -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() {}
|
||||
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user