spring-boot/spring-boot-project/spring-boot-tools
Andy Wilkinson e6970243ee Retry read on ClosedByInterruptException
In gh-38154, we started handling ClosedByInterruptException. The
FileChannel was repaired by recreating it and then the exception was
rethrown. This allowed other threads to use the channel that had been
read by an interrupted thread while allowing that interruption to
continue.

This approach has proven to be insufficient as there are scenarios
where the read needs to succeed on the interrupted thread. This
commit updates the handling of ClosedByInterruptException so that
this is the case. The FileChannel is recreated as before but the
thread's interrupted flag is now cleared before retrying the read.
The flag is then reinstated so that any subsequent actions that
should fail due to the interruption will do so.

We could clear and reinstate the interrupted flag before the first
read, rather than catching ClosedByInterruptException. This approach
was rejected as it will have an impact on the performance of the
happy path where the thread hasn't been interrupted.

Fixes gh-38611
2023-12-07 10:49:40 -08:00
..
spring-boot-antlib Rename spring-boot-loader to spring-boot-loader-classic 2023-10-03 15:40:04 -07:00
spring-boot-autoconfigure-processor Merge branch '2.7.x' into 3.0.x 2023-10-03 10:28:51 +01:00
spring-boot-buildpack-platform Merge branch '3.0.x' into 3.1.x 2023-11-21 17:30:54 -06:00
spring-boot-cli Merge branch '3.1.x' 2023-11-07 11:28:52 +01:00
spring-boot-configuration-metadata Replace contains/put/get pattern with computeIfAbsent 2023-08-08 13:12:47 +02:00
spring-boot-configuration-metadata-changelog-generator Escape pipe symbol in properties changelog table cells 2023-11-30 11:37:25 +01:00
spring-boot-configuration-processor Fix test for incremental build of renamed properties class 2023-10-30 15:17:28 +00:00
spring-boot-gradle-plugin Merge branch '3.1.x' 2023-12-05 20:31:17 +00:00
spring-boot-gradle-test-support Merge branch '3.1.x' 2023-12-05 20:31:17 +00:00
spring-boot-jarmode-layertools Rename spring-boot-loader to spring-boot-loader-classic 2023-10-03 15:40:04 -07:00
spring-boot-loader Retry read on ClosedByInterruptException 2023-12-07 10:49:40 -08:00
spring-boot-loader-classic Rename spring-boot-loader to spring-boot-loader-classic 2023-10-03 15:40:04 -07:00
spring-boot-loader-tools Merge branch '3.1.x' 2023-10-19 23:21:42 -07:00
spring-boot-maven-plugin Merge branch '3.0.x' into 3.1.x 2023-11-21 17:30:54 -06:00
spring-boot-properties-migrator Use Stream.toList() 2023-07-05 09:38:19 +01:00
spring-boot-test-support Add container support for Oracle Free which replaces Oracle XE 2023-11-21 11:51:59 -08:00