未验证 提交 727e8834 编写于 作者: H Hongze Cheng 提交者: GitHub

Merge pull request #6540 from taosdata/feature/TD-4700

[feature]<TD-4700>: implement feature TD-4700
......@@ -96,6 +96,7 @@ static SLogBuff *taosLogBuffNew(int32_t bufSize);
static void taosCloseLogByFd(int32_t oldFd);
static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum);
extern void taosPrintGlobalCfg();
static volatile int8_t tsNoDisk = 0;
static int32_t taosStartLog() {
pthread_attr_t threadAttr;
......@@ -365,9 +366,17 @@ static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum) {
void taosPrintLog(const char *flags, int32_t dflag, const char *format, ...) {
if (tsTotalLogDirGB != 0 && tsAvailLogDirGB < tsMinimalLogDirGB) {
printf("server disk:%s space remain %.3f GB, total %.1f GB, stop print log.\n", tsLogDir, tsAvailLogDirGB, tsTotalLogDirGB);
char buf[256] = "\0";
sprintf(buf, "server disk:%s space remain %.3f GB, total %.1f GB, stop print log.\n", tsLogDir, tsAvailLogDirGB,
tsTotalLogDirGB);
if (atomic_val_compare_exchange_8(&tsNoDisk, 0, 1) == 1) {
taosWrite(tsLogObj.logHandle->fd, buf, (uint32_t)strlen(buf));
}
puts(buf);
fflush(stdout);
return;
} else {
atomic_store_8(&tsNoDisk, 0);
}
va_list argpointer;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册