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

/metrics output got truncated on Japanese locale #5164

Closed
fmhwong opened this issue Sep 21, 2018 · 0 comments
Closed

/metrics output got truncated on Japanese locale #5164

fmhwong opened this issue Sep 21, 2018 · 0 comments
Assignees
Labels
release bug This bug is present in a released version of Open Liberty release-18.0.0.4 team:Lumberjack

Comments

@fmhwong
Copy link
Member

fmhwong commented Sep 21, 2018

We recently got a PMR (TS001217448) on the mpMetrics endpoint /metrics and the response got truncated when Japanese locale was used. L2 found https://www-01.ibm.com/support/docview.wss?uid=swg1PM71666 and we worked around the problem.

The question is whether application code should explicitly close the Writer or not.

Should writer.close() be changed to writer.flush() in line 244?

I emailed Manuel Saldana and Phu Dinh.

Here is the reply from Manuel Saldana:
Since this is primarily Web Container code, I think it would be to our benefit to include Phu Dinh in the conversation. Looking over the code, the issue seems to be in how the JDK eventually handles multi byte characters. The client could be told that there are less bytes to read than what will actually be sent. The close method looks to be calling flush at the very end of its instrumentation. As such, I'm not convinced that doing flush, without setting the custom property, guarantees that the issue is avoided. What the custom property does is set the content length header and set the commit flag immediately after, but before calling flush. If flush is called without the property, then I do not see any special consideration made on the content length header.

Here is the reply from Phu:
You may want to test out with flush() to see what happen. The main point to focus on is whether the content-length header is set or not when you change to flush(). Some customers are sensitive to the content-length VS chunked response (due to performance).

With the custom property set, we skip the setting for content-length header but still call flush(). The content-length will eventually set automatically at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release bug This bug is present in a released version of Open Liberty release-18.0.0.4 team:Lumberjack
Projects
None yet
Development

No branches or pull requests

3 participants