vttranlina commented on code in PR #2629: URL: https://github.com/apache/james-project/pull/2629#discussion_r1950207094
########## server/protocols/webadmin/webadmin-http-client/src/main/java/org/apache/james/webadmin/httpclient/WebAdminHTTPClientFactory.java: ########## @@ -34,6 +35,7 @@ public static Feign.Builder feignBuilder(String bearerToken) { public static Feign.Builder feignBuilder() { return Feign.builder() + .client(new OkHttpClient()) Review Comment: The default Feign HTTP client causes Spark to throw exceptions and become unstable under concurrent requests. This can be reproduced by running tests in the webadmin-cli module. Notably, the same HTTP requests work fine via Postman or curl. Stacktrace from spark ```java org.eclipse.jetty.io.EofException: Closed at org.eclipse.jetty.ee10.servlet.HttpOutput.checkWritable(HttpOutput.java:701) at org.eclipse.jetty.ee10.servlet.HttpOutput.write(HttpOutput.java:731) at java.base/java.io.OutputStream.write(OutputStream.java:124) at spark.serialization.DefaultSerializer.process(DefaultSerializer.java:38) at spark.serialization.Serializer.processElement(Serializer.java:49) at spark.serialization.Serializer.processElement(Serializer.java:52) at spark.serialization.Serializer.processElement(Serializer.java:52) at spark.serialization.SerializerChain.process(SerializerChain.java:53) at spark.http.matching.Body.serializeTo(Body.java:72) at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:201) ``` Http response ```xml <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> <title>Error 500 org.eclipse.jetty.io.EofException: Closed</title> </head> <body> <h2>HTTP ERROR 500 org.eclipse.jetty.io.EofException: Closed</h2> <table> <tr><th>URI:</th><td>http://127.0.0.1:63470/domains/linagora.com</td></tr> <tr><th>STATUS:</th><td>500</td></tr> <tr><th>MESSAGE:</th><td>org.eclipse.jetty.io.EofException: Closed</td></tr> </table> <hr/><a href="https://jetty.org/">Powered by Jetty:// 12.0.15</a><hr/> </body> </html> ``` A simpler way is to use OkHttpClient, which we already use elsewhere. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org