Skip to content

Commit

Permalink
Disabling some IO error assertion in EnvLogger (facebook#11314)
Browse files Browse the repository at this point in the history
Summary:
Right now, EnvLogger has the same IO error assertion as most other places: if we are writing to the file after we've seen an IO error, the assertion would trigger. This is too strict for info logger: we would not fail DB if info logger fails and we would try the best to continue logging. For now, we simplify the problem by disabling the assertion for EnvLogger.

Pull Request resolved: facebook#11314

Test Plan: Run env_logger_test to make sure at least it doesn't fail in normal cases.

Reviewed By: anand1976

Differential Revision: D44227732

fbshipit-source-id: e3d31a221a5757f018a67ccaa96dcf89eb981f66
  • Loading branch information
siying authored and facebook-github-bot committed Mar 20, 2023
1 parent 8c44540 commit cea81ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions logging/env_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class EnvLogger : public Logger {
if (flush_pending_) {
flush_pending_ = false;
file_.Flush().PermitUncheckedError();
file_.reset_seen_error();
}
last_flush_micros_ = clock_->NowMicros();
}
Expand Down Expand Up @@ -162,6 +163,7 @@ class EnvLogger : public Logger {
FileOpGuard guard(*this);
// We will ignore any error returned by Append().
file_.Append(Slice(base, p - base)).PermitUncheckedError();
file_.reset_seen_error();
flush_pending_ = true;
const uint64_t now_micros = clock_->NowMicros();
if (now_micros - last_flush_micros_ >= flush_every_seconds_ * 1000000) {
Expand Down

0 comments on commit cea81ca

Please sign in to comment.