Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ImapIdleChA for scheduling race condition (#8670)
* Fix ImapIdleChA for scheduling race condition The IMAP IDLE is long-lived process and can be blocked waiting for any reply from the server. This way it is not suited to be used in a `TaskScheduler` especially when it has only one thread in its pool in Spring Boot by default. Another concurrent scheduled task is exactly an `ImapMailReceiver.IdleCanceller`. With a single thread in a `TaskScheduler` pool it cannot be reached therefore we never cancel and IDLE task and cannot react to the connection loss properly * Rework the `ImapIdleChannelAdapter` logic to use a regular `Executor` and `while()` loop with a `Thread.sleep()` when we lose connection * Clean up the `ImapMailReceiverTests` from `TaskScheduler` not used anymore. * Expose new `taskExecutor` option in the `ImapIdleChannelAdapterSpec` for Java DSL * Enable `ImapMailReceiverTests.testIdleWithMessageMapping()` with an attempt to see if this fix covers an unclear problem exposed before * * The `testIdleWithMessageMapping()` still fails on GH actions
- Loading branch information
1 parent
9597b7a
commit e4c1851
Showing
3 changed files
with
99 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters