Skip to content

Commit

Permalink
Hotfix spurious Flock warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Madeeks committed Feb 8, 2024
1 parent 606f2f1 commit 169ea21
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/common/Flock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,19 @@ void Flock::release() {
if (fileFd >= 0) {
if (flock(fileFd, LOCK_UN | LOCK_NB) == -1) {
auto message = boost::format("failed to release lock on %s (fd %d): %s") % *lockfile % fileFd % strerror(errno);
logger->log(message.str(), loggerSubsystemName, common::LogLevel::WARN);
// FIXME: this should be a warning, but currently the lock handover during atomic updates of the local
// repo metadata file is not completely clean, so it triggers this message about the temporary file,
// even if there is nothing wrong and the operation completes successfully.
// Temporarily demoting this message to INFO.
logger->log(message.str(), loggerSubsystemName, common::LogLevel::INFO);
}
if(close(fileFd) != 0) {
auto message = boost::format("failed to close file descriptor %d of file %s") % fileFd % *lockfile;
logger->log(message.str(), loggerSubsystemName, common::LogLevel::WARN);
// FIXME: this should be a warning, but currently the lock handover during atomic updates of the local
// repo metadata file is not completely clean, so it triggers this message about the temporary file,
// even if there is nothing wrong and the operation completes successfully.
// Temporarily demoting this message to INFO.
logger->log(message.str(), loggerSubsystemName, common::LogLevel::INFO);
}
}
}
Expand Down

0 comments on commit 169ea21

Please sign in to comment.