[ 
https://issues.apache.org/jira/browse/HADOOP-20005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jose Luis López updated HADOOP-20005:
-------------------------------------
    Description: 
When {{ImageServlet}} refuses a transfer, it reports why only in the reason 
phrase, set through a cast to Jetty's {{Response}}. The servlet closes its 
output stream on every request, which commits the response before the container 
can write an error page. On a container that sends no custom phrase, which is 
Jetty 12 (HADOOP-19972), the SecondaryNameNode or standby NameNode is left with 
a bare status code.

h3. Changes
* {{ImageServlet}} writes the reason into the body itself, so the reason no 
longer depends on how the container renders errors. It keeps the phrase through 
{{setStatus(int, String)}}, without the Jetty cast.
* The three readers of a failed transfer read the body before falling back to 
the phrase: {{Util#doGetUrl}}, {{TransferFsImage}}'s upload, and 
{{EditLogFileInputStream}}. They use the reader added in HADOOP-20003.
* A refusal that reaches the servlet's own catch block after the response is 
committed is logged at DEBUG rather than reported a second time.

h3. Compatibility
No change on Jetty 9.4. The reason is in both the phrase and the body.

h3. Tests
{{TestCheckpoint}} asserts the reason the client reports for a refused transfer.

Depends on HADOOP-20003.

  was:
When {{ImageServlet}} refuses a transfer, it reports why only in the reason 
phrase, set through a cast to Jetty's {{Response}}. The servlet closes its 
output stream on every request, which commits the response before the container 
can write an error page. On a container that sends no custom phrase, which is 
Jetty 12 (HADOOP-19972), the SecondaryNameNode or standby NameNode is left with 
a bare status code.

h3. Changes
* {{ImageServlet}} writes the reason into the body itself, so the reason no 
longer depends on how the container renders errors. It keeps the phrase through 
{{setStatus(int, String)}}, without the Jetty cast.
* The three readers of a failed transfer read the body before falling back to 
the phrase: {{Util#doGetUrl}}, {{TransferFsImage}}'s upload, and 
{{EditLogFileInputStream}}. They use the reader added in HADOOP-XXXXX.
* A refusal that reaches the servlet's own catch block after the response is 
committed is logged at DEBUG rather than reported a second time.

h3. Compatibility
No change on Jetty 9.4. The reason is in both the phrase and the body.

h3. Tests
{{TestCheckpoint}} asserts the reason the client reports for a refused transfer.

Depends on HADOOP-XXXXX.


> Write a refused fsimage transfer's reason into the response body
> ----------------------------------------------------------------
>
>                 Key: HADOOP-20005
>                 URL: https://issues.apache.org/jira/browse/HADOOP-20005
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: hdfs
>            Reporter: Jose Luis López
>            Priority: Major
>
> When {{ImageServlet}} refuses a transfer, it reports why only in the reason 
> phrase, set through a cast to Jetty's {{Response}}. The servlet closes its 
> output stream on every request, which commits the response before the 
> container can write an error page. On a container that sends no custom 
> phrase, which is Jetty 12 (HADOOP-19972), the SecondaryNameNode or standby 
> NameNode is left with a bare status code.
> h3. Changes
> * {{ImageServlet}} writes the reason into the body itself, so the reason no 
> longer depends on how the container renders errors. It keeps the phrase 
> through {{setStatus(int, String)}}, without the Jetty cast.
> * The three readers of a failed transfer read the body before falling back to 
> the phrase: {{Util#doGetUrl}}, {{TransferFsImage}}'s upload, and 
> {{EditLogFileInputStream}}. They use the reader added in HADOOP-20003.
> * A refusal that reaches the servlet's own catch block after the response is 
> committed is logged at DEBUG rather than reported a second time.
> h3. Compatibility
> No change on Jetty 9.4. The reason is in both the phrase and the body.
> h3. Tests
> {{TestCheckpoint}} asserts the reason the client reports for a refused 
> transfer.
> Depends on HADOOP-20003.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to