MCPcopy Create free account
hub / github.com/apache/trafficserver / check_fd

Method check_fd

src/proxy/logging/LogFile.cc:722–753  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720 -------------------------------------------------------------------------*/
721
722void
723LogFile::check_fd()
724{
725 static bool failure_last_call = false;
726 static unsigned stat_check_count = 1;
727
728 if ((stat_check_count % Log::config->file_stat_frequency) == 0) {
729 //
730 // It's time to see if the file really exists. If we can't see
731 // the file (via access), then we'll close our descriptor and
732 // attempt to re-open it, which will create the file if it's not
733 // there.
734 //
735 if (m_name && !LogFile::exists(m_name)) {
736 close_file();
737 }
738 stat_check_count = 0;
739 }
740 stat_check_count++;
741
742 int err = open_file();
743 // XXX if open_file() returns, LOG_FILE_FILESYSTEM_CHECKS_FAILED, raise a more informative alarm ...
744 if (err != LOG_FILE_NO_ERROR && err != LOG_FILE_NO_PIPE_READERS) {
745 if (!failure_last_call) {
746 Warning("Traffic Server could not open logfile %s: %s.", m_name, strerror(errno));
747 }
748 failure_last_call = true;
749 return;
750 }
751
752 failure_last_call = false;
753}
754
755void
756LogFile::display(FILE *fd)

Callers 1

flush_thread_mainMethod · 0.80

Calls 2

open_fileFunction · 0.85
existsFunction · 0.50

Tested by

no test coverage detected