From 8030cc30bd96b8a1eadf303370933d48cd0c242b Mon Sep 17 00:00:00 2001 From: l00280231 Date: Tue, 26 Jan 2021 09:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E5=A4=87=E5=9C=BA=E6=99=AF=EF=BC=8C?= =?UTF-8?q?=E5=BD=93=E6=97=A5=E5=BF=97=E6=BB=A1=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E6=AD=BB=E5=BE=AA=E7=8E=AF=E5=86=99=E6=97=A5=E5=BF=97=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=AF=BC=E8=87=B4=E6=95=B0=E6=8D=AE=E5=BA=93=E5=A4=AF?= =?UTF-8?q?=E4=BD=8F=EF=BC=8C=E5=86=99=E6=97=A5=E5=BF=97=E6=97=B6=E5=80=99?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E9=97=AE=E9=A2=98=EF=BC=8C=E5=B0=B1=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E6=AD=BB=E5=BE=AA=E7=8E=AF=E5=86=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/process/postmaster/syslogger.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gausskernel/process/postmaster/syslogger.cpp b/src/gausskernel/process/postmaster/syslogger.cpp index 2384e0853..8bd6a5588 100755 --- a/src/gausskernel/process/postmaster/syslogger.cpp +++ b/src/gausskernel/process/postmaster/syslogger.cpp @@ -701,8 +701,7 @@ static void syslogger_erewrite(FILE* file, const char* buffer) * and we can not report a log, because there is not space to write. */ if (errno == ENOSPC) { - pg_usleep(1000000); - continue; + break; } } break; @@ -966,7 +965,7 @@ void write_syslogger_file(char* buffer, int count, int destination) logfile = (destination == LOG_DESTINATION_CSVLOG) ? t_thrd.logger.csvlogFile : t_thrd.logger.syslogFile; errno = 0; -retry1: + rc = fwrite(buffer, 1, count, logfile); /* can't use ereport here because of possible recursion */ @@ -976,8 +975,7 @@ retry1: * and we can not report a log, because there is not space to write. */ if (errno == ENOSPC) { - pg_usleep(1000000); - goto retry1; + return; } char errorbuf[ERROR_BUF_SIZE] = {'\0'}; rc = sprintf_s(errorbuf, ERROR_BUF_SIZE, "ERROR: could not write to log file: %s\n", gs_strerror(errno)); @@ -1653,8 +1651,7 @@ static void LogCtlFlushBuf(LogControlData* logctl) * and we can not report a log, because there is not space to write. */ if (errno == ENOSPC) { - pg_usleep(1000000); - continue; + break; } /* disk IO error, print message and discard this logs */