The fix should be somewhere in zio.lambda.internal.RuntimeApiLive#sendInvocationError method I guess.
I assume that adding Content-Length header should fix this issue.
Stack trace:
timestamp=2023-04-10T20:49:51.426360090Z level=ERROR thread=#zio-fiber-0 message="" cause="Exception in thread "zio-fiber-4" java.io.IOException: too many bytes written
at java.base/sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3804)
at java.base/sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3795)
at zio.lambda.internal.RuntimeApiLive.postRequest$$anonfun$2(RuntimeApiLive.scala:88)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at zio.ZIOCompanionVersionSpecific.attempt$$anonfun$1(ZIOCompanionVersionSpecific.scala:103)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3804)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3795)
at zio.lambda.internal.RuntimeApiLive.postRequest$$anonfun$2(RuntimeApiLive.scala:88)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at zio.ZIOCompanionVersionSpecific.attempt$$anonfun$1(ZIOCompanionVersionSpecific.scala:103)
at zio.lambda.internal.RuntimeApiLive.postRequest(RuntimeApiLive.scala:90)
at zio.lambda.internal.LoopProcessor.Live.loop(LoopProcessor.scala:32)
at zio.lambda.ZLambda.run(ZLambda.scala:22)"
Can be reproduced something like this:
The fix should be somewhere in
zio.lambda.internal.RuntimeApiLive#sendInvocationError
method I guess. I assume that addingContent-Length
header should fix this issue.Stack trace: