-
Notifications
You must be signed in to change notification settings - Fork 1.1k
FolderClosedException when downloading large file attachments #8577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Forgot to add, simply removing the |
Try with this
And therefore we won't go to the next idle cylce until we finish with the current one. I'm not sure what was the reason initially to have a processing task as an async one, but that is indeed may cause the problem you've just described. I also not sure how to fix it yet, but we definitely cannot keep the folder opened all the time. |
The |
If we don't have messages to emit, therefore there is nothing we can attach that I'm looking into the logic of the |
OK. Too many questions to the |
Fixes spring-projects#8577 When we process mail messages in async manner, it is possible that we end up in a race condition situation where the next idle cycle closes the folder. It is possible to reopen the folder, but feels better to block the current idle cycle until we are done with the message and therefore keep folder opened. * Deprecate `ImapIdleChannelAdapter.sendingTaskExecutor` in favor of an `ExecutorChannel` as an output for this channel adapter or similar async hand-off downstream. * Make use of `shouldReconnectAutomatically` as it is advertised for this channel adapter * Optimize the proxy creation for message sending task
Fixes spring-projects#8577 When we process mail messages in async manner, it is possible that we end up in a race condition situation where the next idle cycle closes the folder. It is possible to reopen the folder, but feels better to block the current idle cycle until we are done with the message and therefore keep folder opened. * Deprecate `ImapIdleChannelAdapter.sendingTaskExecutor` in favor of an `ExecutorChannel` as an output for this channel adapter or similar async hand-off downstream. * Make a default one as a `SyncTaskExecutor` to make a sense of this deprecation
* GH-8577: Deprecate ImapIdleCA.sendingTaskExecutor Fixes #8577 When we process mail messages in async manner, it is possible that we end up in a race condition situation where the next idle cycle closes the folder. It is possible to reopen the folder, but feels better to block the current idle cycle until we are done with the message and therefore keep folder opened. * Deprecate `ImapIdleChannelAdapter.sendingTaskExecutor` in favor of an `ExecutorChannel` as an output for this channel adapter or similar async hand-off downstream. * Make a default one as a `SyncTaskExecutor` to make a sense of this deprecation * Fix language in docs Co-authored-by: Gary Russell <[email protected]> --------- Co-authored-by: Gary Russell <[email protected]>
* GH-8577: Revise `ImapIdleChannelAdapter` logic Fixes #8577 When we process mail messages in async manner, it is possible that we end up in a race condition situation where the next idle cycle closes the folder. It is possible to reopen the folder, but feels better to block the current idle cycle until we are done with the message and therefore keep folder opened. * Deprecate `ImapIdleChannelAdapter.sendingTaskExecutor` in favor of an `ExecutorChannel` as an output for this channel adapter or similar async hand-off downstream. * Make use of `shouldReconnectAutomatically` as it is advertised for this channel adapter * Optimize the proxy creation for message sending task * * Remove `ImapIdleChannelAdapter.sendingTaskExecutor` * Fix language in docs Co-authored-by: Gary Russell <[email protected]> --------- Co-authored-by: Gary Russell <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
In what version(s) of Spring Integration are you seeing this issue?
v6.0.3
Describe the bug
When downloading a large file attachment downstream, the IMAP folder can be closed in subsequent
AbstractMailSender.receive()
when there are no moremessagesToReturn
throwing aFolderClosedException
.From the documentation,
And indeed lines 384-386 in
AbstractMailReceiver
describes this behaviour.To Reproduce
IntegrationFlow
withMail.imapIdleAdapter()
andautoCloseFolder(false)
MessageHandler
that runs theMimeBodyPart.saveFile()
functionExpected behavior
Expect to save attachments regardless of size (save for mail server limits).
Sample
Here's the trace of the error:
The text was updated successfully, but these errors were encountered: