You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2026/08/17 01:43:02 UTC

(james-project) branch master updated: [FIX] Prevent potentially blocking calls upon uploads (#3110)

This is an automated email from the ASF dual-hosted git repository.

chibenwa pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
     new 111a5050bd [FIX] Prevent potentially blocking calls upon uploads (#3110)
111a5050bd is described below

commit 111a5050bdf4720184b992e580ffc71aae8f77f2
Author: Benoit TELLIER <bt...@linagora.com>
AuthorDate: Mon Aug 17 08:42:55 2026 +0700

    [FIX] Prevent potentially blocking calls upon uploads (#3110)
---
 .../src/main/scala/org/apache/james/jmap/routes/UploadRoutes.scala      | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/UploadRoutes.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/UploadRoutes.scala
index 1d3a458351..c21862cdf6 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/UploadRoutes.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/UploadRoutes.scala
@@ -129,6 +129,8 @@ class UploadRoutes @Inject()(@Named(InjectionKeys.RFC_8621) val authenticator: A
       .asByteArray()
       .map(array => ByteBuffer.wrap(array))))
       .flatMap(content => handle(targetAccountId, contentType, content, session, response))
+      // Reading that Flux[ByteBuffer] backed InputStream blocks, and authentication may well have completed on a non blocking thread
+      .subscribeOn(ReactorUtils.BLOCKING_CALL_WRAPPER)
 
   def handle(accountId: AccountId, contentType: ContentType, content: InputStream, mailboxSession: MailboxSession, response: HttpServerResponse): SMono[Void] = {
     val maxSize: Long = configuration.maxUploadSize.value.value


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org