Git Product home page Git Product logo

Comments (7)

cy6erGn0m avatar cy6erGn0m commented on April 28, 2024 1

@mathiasbn Could you please try again with latest master?

from ktor.

cy6erGn0m avatar cy6erGn0m commented on April 28, 2024

Can't reproduce it for now.
Btw Jetty for some reason desn't check if HttpInput was closed in setReadListener so I guess that the cause is that the connection is already closed/recycled while we are trying to read it later. I am going to make request completion more strict so channel will be closed. Most likely you will get ClosedChannelException instead.

from ktor.

mathiasbn avatar mathiasbn commented on April 28, 2024

Sorry for the delay. Pretty much the same stacktrace

java.lang.IllegalStateException: ReadListener already set
	at org.eclipse.jetty.server.HttpInput.setReadListener(HttpInput.java:600) ~[jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
	at org.jetbrains.ktor.servlet.ServletReadChannel.read(ServletReadChannel.kt:51) ~[ktor-servlet-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.nio.AsyncReadChannelAdapterStream.read(Channels.kt:114) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) ~[na:1.8.0_60]
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) ~[na:1.8.0_60]
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[na:1.8.0_60]
	at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[na:1.8.0_60]
	at java.io.Reader.read(Reader.java:140) ~[na:1.8.0_60]
	at kotlin.io.TextStreamsKt.copyTo(ReadWrite.kt:116) ~[kotlin-stdlib-1.0.5-2.jar:1.0.5-2]
	at kotlin.io.TextStreamsKt.copyTo$default(ReadWrite.kt:113) ~[kotlin-stdlib-1.0.5-2.jar:1.0.5-2]
	at kotlin.io.TextStreamsKt.readText(ReadWrite.kt:100) ~[kotlin-stdlib-1.0.5-2.jar:1.0.5-2]
	at org.jetbrains.ktor.request.RequestContent$contentAsString$2.invoke(RequestContent.kt:11) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.request.RequestContent$contentAsString$2.invoke(RequestContent.kt:10) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) ~[kotlin-stdlib-1.0.5-2.jar:1.0.5-2]
	at org.jetbrains.ktor.request.RequestContent.getContentAsString(RequestContent.kt) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.request.RequestContent.get(RequestContent.kt:37) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.request.RequestContent$computedValuesMap$2.invoke(RequestContent.kt:49) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.request.RequestContent$computedValuesMap$2.invoke(RequestContent.kt:10) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) ~[kotlin-stdlib-1.0.5-2.jar:1.0.5-2]
	at org.jetbrains.ktor.request.RequestContent.getComputedValuesMap(RequestContent.kt) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.request.RequestContent.get(RequestContent.kt:38) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.host.BaseApplicationCall$parameters$2.invoke(BaseApplicationCall.kt:185) ~[ktor-hosts-common-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.host.BaseApplicationCall$parameters$2.invoke(BaseApplicationCall.kt:13) ~[ktor-hosts-common-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) ~[kotlin-stdlib-1.0.5-2.jar:1.0.5-2]
	at org.jetbrains.ktor.host.BaseApplicationCall.getParameters(BaseApplicationCall.kt) ~[ktor-hosts-common-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.routing.Routing.interceptor(Routing.kt:10) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.routing.Routing.access$interceptor(Routing.kt:7) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt:28) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt:23) ~[ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.pipeline.PipelineMachine.runAction(PipelineMachine.kt:111) [ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.pipeline.PipelineMachine.loop(PipelineMachine.kt:103) [ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.pipeline.PipelineMachine.proceed(PipelineMachine.kt:25) [ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.pipeline.PipelineMachine.execute(PipelineMachine.kt:16) [ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.pipeline.AsyncKt$executeOn$1.get(Async.kt:30) [ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at org.jetbrains.ktor.pipeline.AsyncKt$executeOn$1.get(Async.kt) [ktor-core-0.2.4-MOINZ-SNAPSHOT.jar:0.2.4-MOINZ-SNAPSHOT]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) [na:1.8.0_60]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_60]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_60]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_60]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_60]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]

from ktor.

cy6erGn0m avatar cy6erGn0m commented on April 28, 2024

Could you please provide code so I can reproduce it?

from ktor.

mathiasbn avatar mathiasbn commented on April 28, 2024

You just need to set a suspend Thread breakpoint in a post, and then call it with a
Content-Type: application/x-www-form-urlencoded request.

We suspect it is a sideeffect of an issue with async servlets having a timeout of 30 seconds after which it is called again (Issue #54 )

from ktor.

cy6erGn0m avatar cy6erGn0m commented on April 28, 2024

@mathiasbn could you please confirm that the solution from PR #54 fixes the issue?

from ktor.

mathiasbn avatar mathiasbn commented on April 28, 2024

It does.

from ktor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.