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

log: do not repeat errors to stderr #7983

Merged
merged 1 commit into from Mar 11, 2016
Merged

Conversation

liewegas
Copy link
Member

@liewegas liewegas commented Mar 8, 2016

If we get an error writing to the log, log it only once to stderr.
This avoids generating, say, 72 GB of ENOSPC errors in
teuthology.log when /var/log fills up.

Fixes: #14616
Signed-off-by: Sage Weil sage@redhat.com

@liewegas liewegas added this to the jewel milestone Mar 8, 2016
if (r < 0)
cerr << "problem writing to " << m_log_file << ": " << cpp_strerror(r)
<< std::endl;
if (r > 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems safe_write() does not return an r > 0

@tchaikov
Copy link
Contributor

lgtm modulo the nit.

If we get an error writing to the log, log it only once to stderr.
This avoids generating, say, 72 GB of ENOSPC errors in
teuthology.log when /var/log fills up.

Fixes: ceph#14616
Signed-off-by: Sage Weil <sage@redhat.com>
@tchaikov
Copy link
Contributor

lgtm

liewegas added a commit that referenced this pull request Mar 11, 2016
log: do not repeat errors to stderr

Reviewed-by: Kefu Chai <kchai@redhat.com>
@liewegas liewegas merged commit 4ab0fc5 into ceph:master Mar 11, 2016
@liewegas liewegas deleted the wip-14616 branch March 11, 2016 15:30
@zmc
Copy link
Member

zmc commented Mar 11, 2016

🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants