diff options
author | Stan Hu <stanhu@gmail.com> | 2018-09-11 22:55:01 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-09-11 23:12:23 -0700 |
commit | 95e292780492ea764328566503ebefcae8a170f3 (patch) | |
tree | 3e79f94ded694e27336e059063463e2018cb83c5 /support/rewrite-hooks.sh | |
parent | e5b6e8e2550e203978cd25d3e07ca468b4d06c91 (diff) | |
download | gitlab-shell-sh-fix-nonatomic-puts.tar.gz |
Fix newlines not appearing between new log entriessh-fix-nonatomic-puts
In https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/5017, we
observed that lots of log messages were being dropped by Fluentd due to
missing newlines.
This occurs because there is a bug in Ruby where IO#puts calls write() twice:
once to write the main text, and another to write the newline
(https://bugs.ruby-lang.org/issues/14042). In a highly concurrent environment
like GitLab.com, this can lead to interleaved newlines.
A workaround is to use `IO#print` and append the newline ourselves.
Closes https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/5017
Diffstat (limited to 'support/rewrite-hooks.sh')
0 files changed, 0 insertions, 0 deletions