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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to