You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Jason Walton (JIRA)" <ji...@apache.org> on 2008/09/11 21:53:44 UTC
[jira] Created: (SYNAPSE-443) If ClientHandler receives a response
of bad request from http server, causes many NullPointerExceptions.
If ClientHandler receives a response of bad request from http server, causes many NullPointerExceptions.
--------------------------------------------------------------------------------------------------------
Key: SYNAPSE-443
URL: https://issues.apache.org/jira/browse/SYNAPSE-443
Project: Synapse
Issue Type: Bug
Components: Transports
Affects Versions: 1.3
Reporter: Jason Walton
In ClientHandler.responseReceived(), if the resposne.getStatusLine().getStatusCode() is HttpStatus.SC_BAD_REQUEST, we log the error and return. After this, IO Reactor tries to stream the response content to us with a call to inputReady(), however the RESPONSE_SINK_BUFFER will be null, so we throw a NullPointerException. IO Reactor will continue to try to deliver content to us, so the result is a huge pile of NullPointerExceptions.
Easy fix seems to be to call "processResponse()" in the SC_BAD_REQUEST case of the switch statement, like every other case does.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-443) If ClientHandler receives a
response of bad request from http server, causes many
NullPointerExceptions.
Posted by "Jason Walton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636618#action_12636618 ]
Jason Walton commented on SYNAPSE-443:
--------------------------------------
The easiest way to test this that I can think of would be to write a quick and dirty "dummy web server", which always returns bad request. Make sure you read the request from Synapse completely before returning 400, if you go this route, otherwise you'll likely also get errors from IOReactor (see SYNAPSE-341).
The other obvious way would be to hack up Synapse so it actually generates bad requests.
I have seen this exact problem happen (which is how I found it in the first place), but in my case I was sending requests to a closed-source web server written by a third party. So it's possible there's some code path that causes Synapse to send bad requests, but to be honest I'm somewhat suspicious of the web server in question. :)
> If ClientHandler receives a response of bad request from http server, causes many NullPointerExceptions.
> --------------------------------------------------------------------------------------------------------
>
> Key: SYNAPSE-443
> URL: https://issues.apache.org/jira/browse/SYNAPSE-443
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.3
> Reporter: Jason Walton
> Assignee: Ruwan Linton
>
> In ClientHandler.responseReceived(), if the resposne.getStatusLine().getStatusCode() is HttpStatus.SC_BAD_REQUEST, we log the error and return. After this, IO Reactor tries to stream the response content to us with a call to inputReady(), however the RESPONSE_SINK_BUFFER will be null, so we throw a NullPointerException. IO Reactor will continue to try to deliver content to us, so the result is a huge pile of NullPointerExceptions.
> Easy fix seems to be to call "processResponse()" in the SC_BAD_REQUEST case of the switch statement, like every other case does.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Resolved: (SYNAPSE-443) If ClientHandler receives a response
of bad request from http server, causes many NullPointerExceptions.
Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ruwan Linton resolved SYNAPSE-443.
----------------------------------
Resolution: Fixed
Fix Version/s: 1.3
Fixed on the trunk..
> If ClientHandler receives a response of bad request from http server, causes many NullPointerExceptions.
> --------------------------------------------------------------------------------------------------------
>
> Key: SYNAPSE-443
> URL: https://issues.apache.org/jira/browse/SYNAPSE-443
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.3
> Reporter: Jason Walton
> Assignee: Ruwan Linton
> Fix For: 1.3
>
>
> In ClientHandler.responseReceived(), if the resposne.getStatusLine().getStatusCode() is HttpStatus.SC_BAD_REQUEST, we log the error and return. After this, IO Reactor tries to stream the response content to us with a call to inputReady(), however the RESPONSE_SINK_BUFFER will be null, so we throw a NullPointerException. IO Reactor will continue to try to deliver content to us, so the result is a huge pile of NullPointerExceptions.
> Easy fix seems to be to call "processResponse()" in the SC_BAD_REQUEST case of the switch statement, like every other case does.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Assigned: (SYNAPSE-443) If ClientHandler receives a response
of bad request from http server, causes many NullPointerExceptions.
Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ruwan Linton reassigned SYNAPSE-443:
------------------------------------
Assignee: Ruwan Linton
> If ClientHandler receives a response of bad request from http server, causes many NullPointerExceptions.
> --------------------------------------------------------------------------------------------------------
>
> Key: SYNAPSE-443
> URL: https://issues.apache.org/jira/browse/SYNAPSE-443
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.3
> Reporter: Jason Walton
> Assignee: Ruwan Linton
>
> In ClientHandler.responseReceived(), if the resposne.getStatusLine().getStatusCode() is HttpStatus.SC_BAD_REQUEST, we log the error and return. After this, IO Reactor tries to stream the response content to us with a call to inputReady(), however the RESPONSE_SINK_BUFFER will be null, so we throw a NullPointerException. IO Reactor will continue to try to deliver content to us, so the result is a huge pile of NullPointerExceptions.
> Easy fix seems to be to call "processResponse()" in the SC_BAD_REQUEST case of the switch statement, like every other case does.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-443) If ClientHandler receives a
response of bad request from http server, causes many
NullPointerExceptions.
Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636522#action_12636522 ]
Ruwan Linton commented on SYNAPSE-443:
--------------------------------------
Can you please point me how to reproduce this issue? By looking at the code your suggestion seems to work because even in the case of unknown status code we call processResponse(), but I need to test this before committing the fix.
> If ClientHandler receives a response of bad request from http server, causes many NullPointerExceptions.
> --------------------------------------------------------------------------------------------------------
>
> Key: SYNAPSE-443
> URL: https://issues.apache.org/jira/browse/SYNAPSE-443
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.3
> Reporter: Jason Walton
> Assignee: Ruwan Linton
>
> In ClientHandler.responseReceived(), if the resposne.getStatusLine().getStatusCode() is HttpStatus.SC_BAD_REQUEST, we log the error and return. After this, IO Reactor tries to stream the response content to us with a call to inputReady(), however the RESPONSE_SINK_BUFFER will be null, so we throw a NullPointerException. IO Reactor will continue to try to deliver content to us, so the result is a huge pile of NullPointerExceptions.
> Easy fix seems to be to call "processResponse()" in the SC_BAD_REQUEST case of the switch statement, like every other case does.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org