Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout throwing an exception for something that has already been handled. #32

Closed
RichardHightower opened this issue Nov 7, 2014 · 4 comments
Labels

Comments

@RichardHightower
Copy link
Member

[QueueListener Response Queue /services] DEBUG i.a.q.s.Server - Response not marked handled and it timed out, but could not be written io.advantageous.qbit.http.HttpRequest@87a022a3
java.lang.IllegalStateException: Response has already been written
at org.vertx.java.core.http.impl.DefaultHttpServerResponse.checkWritten(DefaultHttpServerResponse.java:452) ~[vertx-core-2.1.1.jar:na]
at org.vertx.java.core.http.impl.DefaultHttpServerResponse.putHeader(DefaultHttpServerResponse.java:128) ~[vertx-core-2.1.1.jar:na]
at org.vertx.java.core.http.impl.DefaultHttpServerResponse.putHeader(DefaultHttpServerResponse.java:39) ~[vertx-core-2.1.1.jar:na]
at io.advantageous.qbit.vertx.http.HttpServerVertx.lambda$createResponse$13(HttpServerVertx.java:184) ~[qbit-vertx/:na]
at io.advantageous.qbit.vertx.http.HttpServerVertx$$Lambda$15/289205234.response(Unknown Source) ~[na:na]
at io.advantageous.qbit.server.Server.handleMethodTimedOut(Server.java:504) [qbit-boon/:na]
at io.advantageous.qbit.server.Server.checkTimeoutsForRequests(Server.java:475) [qbit-boon/:na]
at io.advantageous.qbit.server.Server.access$200(Server.java:39) [qbit-boon/:na]
at io.advantageous.qbit.server.Server$1.idle(Server.java:268) [qbit-boon/:na]

@tausif-citrusPay
Copy link

Has this been resolved? I am facing this issue and don't know how to resolve.

@RichardHightower
Copy link
Member Author

I was able to resolve this. It could be that you are running into in another scenario which could be a bug or could be not using the API as expected. Can you create small test case that reproduces the bug? And the issue a PR with said test case.

@tausif-citrusPay
Copy link

HI Richard,
Thanks for your prompt reply. After debugging in my code I found that using "context.next()" is causing the issue. Since "context.next" ends the context and if we write response into context somewhere else in the code the exception will occur.For example

`Class Test {
function test_1(){
// some code
context.next();
}
function test_2(){
result = some_code;
context.response().end(result);

}`

@RichardHightower
Copy link
Member Author

Context? context.next()... Not sure any of this is QBit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants