You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "bvolpato (via GitHub)" <gi...@apache.org> on 2023/03/22 03:47:00 UTC
[GitHub] [beam] bvolpato opened a new pull request, #25922: Increase logging buffer size to 256kb
bvolpato opened a new pull request, #25922:
URL: https://github.com/apache/beam/pull/25922
DataflowWorkerLoggingHandler writes logs using a BufferedOutputStream, which [by default holds 8192 bytes](https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/io/BufferedOutputStream.java#L43).
Which means that large logs can be split up in multiple flushes -- and that can cause Cloud Logging to have partial writes when reading files, causing parse problems due to invalid/incomplete JSON.
This change increases the buffer size from 8kb to match [Cloud Logging's limit](https://cloud.google.com/logging/quotas#log-limits): 256 kb, so we make sure that the buffer can hold any entry.
In general, the latency won't be affected, as after every call to `publish`, [`flush` is guaranteed](https://github.com/apache/beam/blob/master/runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/logging/DataflowWorkerLoggingHandler.java#L166-L171).
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] ~Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.~
- [ ] ~Update `CHANGES.md` with noteworthy changes.~
- [x] ~If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).~
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/get-started-contributing/#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] Abacn merged pull request #25922: Increase logging buffer size to 256kb
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn merged PR #25922:
URL: https://github.com/apache/beam/pull/25922
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] bvolpato commented on pull request #25922: Increase logging buffer size to 256kb
Posted by "bvolpato (via GitHub)" <gi...@apache.org>.
bvolpato commented on PR #25922:
URL: https://github.com/apache/beam/pull/25922#issuecomment-1478906899
Run Java PreCommit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] Abacn commented on pull request #25922: Increase logging buffer size to 256kb
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #25922:
URL: https://github.com/apache/beam/pull/25922#issuecomment-1481165731
merged but realized and curious that will this delay the occurrence of log entry available on Dataflow runner?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] Abacn commented on pull request #25922: Increase logging buffer size to 256kb
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #25922:
URL: https://github.com/apache/beam/pull/25922#issuecomment-1480456630
Thanks for the catch! From the linked google cloud documentation it says "This approximate limit is based on internal data sizes, not the actual REST API request size." As this is an "approximate", do we want some redundancy (like set to 250 kB)? Or have you able to test if 256 kB size works with Dataflow?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] bvolpato commented on pull request #25922: Increase logging buffer size to 256kb
Posted by "bvolpato (via GitHub)" <gi...@apache.org>.
bvolpato commented on PR #25922:
URL: https://github.com/apache/beam/pull/25922#issuecomment-1480489412
Thanks @Abacn -- it's not actually going to change the log entry size or incur new limits, it's just going to write in less flushes to disk. Dataflow today runs a scanner agent from time to time to send logs, and with a large enough buffer, there's less chance that it will read "intermediary" logs.
This will reduce the chance that logs will be chopped. I did test this ([gist](https://gist.github.com/bvolpato/a971be6c5c72d882a1eff4d09edec864)) and the occurrences reduced considerably.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] bvolpato commented on pull request #25922: Increase logging buffer size to 256kb
Posted by "bvolpato (via GitHub)" <gi...@apache.org>.
bvolpato commented on PR #25922:
URL: https://github.com/apache/beam/pull/25922#issuecomment-1482996484
> The original problem is that log view from dataflow ui get truncated when it is longer than the buffer
Precisely, thanks @Abacn!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org