You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2007/04/28 14:34:15 UTC

[jira] Created: (HTTPCLIENT-650) Wife log is incomplete if HttpParser detects an error

Wife log is incomplete if HttpParser detects an error
-----------------------------------------------------

                 Key: HTTPCLIENT-650
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-650
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 3.1 RC1
            Reporter: Sebb
            Priority: Minor


If HttpParser detects an error in any of the headers, it throws a ProtocolException

Although the failing header is included in the Exception detail, the headers leading up to the failure are not logged, which makes it hard to debug (and is quite confusing, as the PE does not appear to be related to the data that has been received).

This is because the wire-logging is done in the caller (HttpMethodDirector) which only logs the header if the parse succeeds.

Perhaps the Wire logging should be done at the point where the HttpParser reads the line.

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: [jira] Updated: (HTTPCLIENT-650) Wire log is incomplete if HttpParser detects an error

Posted by sebb <se...@gmail.com>.
On 28/04/07, Roland Weber (JIRA) <ji...@apache.org> wrote:
>
>     [ https://issues.apache.org/jira/browse/HTTPCLIENT-650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Roland Weber updated HTTPCLIENT-650:
> ------------------------------------
>
>    Attachment: 2k7-04-28-wire-log.txt
>
> Sebastian, thanks a lot for figuring this out. The situation is indeed even a bit worse, because what is logged is not the actual input from the wire, but what is returned by the parser. That's after stripping ignorable whitespace and concatenating continuation lines.

No problem.

I was having a look at the "Unable to parse header : HTTP/1.1 200 OK"
problem posted by Eugeny, as it seemed it might crop up on the JMeter
user list at some point - this is when I found that the wire log did
not really help.

I've not tried it yet, but the fix looks fine to me; thanks for fixing
it so quickly.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Commented: (HTTPCLIENT-650) Wire log is incomplete if HttpParser detects an error

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492504 ] 

Oleg Kalnichevski commented on HTTPCLIENT-650:
----------------------------------------------

Looks good to me

Oleg

> Wire log is incomplete if HttpParser detects an error
> -----------------------------------------------------
>
>                 Key: HTTPCLIENT-650
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-650
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 3.1 RC1
>            Reporter: Sebb
>            Priority: Minor
>         Attachments: 2k7-04-28-wire-log.txt
>
>
> If HttpParser detects an error in any of the headers, it throws a ProtocolException
> Although the failing header is included in the Exception detail, the headers leading up to the failure are not logged, which makes it hard to debug (and is quite confusing, as the PE does not appear to be related to the data that has been received).
> This is because the wire-logging is done in the caller (HttpMethodDirector) which only logs the header if the parse succeeds.
> Perhaps the Wire logging should be done at the point where the HttpParser reads the line.

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Resolved: (HTTPCLIENT-650) Wire log is incomplete if HttpParser detects an error

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roland Weber resolved HTTPCLIENT-650.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1 Final

patch committed

> Wire log is incomplete if HttpParser detects an error
> -----------------------------------------------------
>
>                 Key: HTTPCLIENT-650
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-650
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 3.1 RC1
>            Reporter: Sebb
>            Priority: Minor
>             Fix For: 3.1 Final
>
>         Attachments: 2k7-04-28-wire-log.txt
>
>
> If HttpParser detects an error in any of the headers, it throws a ProtocolException
> Although the failing header is included in the Exception detail, the headers leading up to the failure are not logged, which makes it hard to debug (and is quite confusing, as the PE does not appear to be related to the data that has been received).
> This is because the wire-logging is done in the caller (HttpMethodDirector) which only logs the header if the parse succeeds.
> Perhaps the Wire logging should be done at the point where the HttpParser reads the line.

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Updated: (HTTPCLIENT-650) Wire log is incomplete if HttpParser detects an error

Posted by "Ortwin Glück (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ortwin Glück updated HTTPCLIENT-650:
------------------------------------

    Summary: Wire log is incomplete if HttpParser detects an error  (was: Wife log is incomplete if HttpParser detects an error)

> Wire log is incomplete if HttpParser detects an error
> -----------------------------------------------------
>
>                 Key: HTTPCLIENT-650
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-650
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 3.1 RC1
>            Reporter: Sebb
>            Priority: Minor
>
> If HttpParser detects an error in any of the headers, it throws a ProtocolException
> Although the failing header is included in the Exception detail, the headers leading up to the failure are not logged, which makes it hard to debug (and is quite confusing, as the PE does not appear to be related to the data that has been received).
> This is because the wire-logging is done in the caller (HttpMethodDirector) which only logs the header if the parse succeeds.
> Perhaps the Wire logging should be done at the point where the HttpParser reads the line.

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Updated: (HTTPCLIENT-650) Wire log is incomplete if HttpParser detects an error

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roland Weber updated HTTPCLIENT-650:
------------------------------------

    Attachment: 2k7-04-28-wire-log.txt

Sebastian, thanks a lot for figuring this out. The situation is indeed even a bit worse, because what is logged is not the actual input from the wire, but what is returned by the parser. That's after stripping ignorable whitespace and concatenating continuation lines.
Attached patch moves wire logging for headers (but not for the status line) from HttpMethodBase to HttpParser.readLine(...). Somebody please review this _carefully_. I know it compiles, but I don't have the environment set up to test whether it actually logs as expected...

cheers,
  Roland



> Wire log is incomplete if HttpParser detects an error
> -----------------------------------------------------
>
>                 Key: HTTPCLIENT-650
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-650
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 3.1 RC1
>            Reporter: Sebb
>            Priority: Minor
>         Attachments: 2k7-04-28-wire-log.txt
>
>
> If HttpParser detects an error in any of the headers, it throws a ProtocolException
> Although the failing header is included in the Exception detail, the headers leading up to the failure are not logged, which makes it hard to debug (and is quite confusing, as the PE does not appear to be related to the data that has been received).
> This is because the wire-logging is done in the caller (HttpMethodDirector) which only logs the header if the parse succeeds.
> Perhaps the Wire logging should be done at the point where the HttpParser reads the line.

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org