Merge pull request #2883 from taosdata/feature/td-1033

td-1033: fix high cpu usage
This commit is contained in:
Shengliang Guan 2020-08-03 09:29:32 +08:00 committed by GitHub
commit a63daaf77c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -235,7 +235,9 @@ static void* telemetryThread(void* param) {
}
int startAt = taosGetTimestampSec();
struct timespec timeout = {.tv_sec = timeToWait, .tv_nsec = 0};
struct timespec timeout = {.tv_sec = 0, .tv_nsec = 0};
clock_gettime(CLOCK_REALTIME, &timeout);
timeout.tv_sec += timeToWait;
if (sem_timedwait(&tsExitSem, &timeout) == 0) {
break;
}
@ -279,4 +281,4 @@ void dnodeCleanupTelemetry() {
pthread_join(tsTelemetryThread, NULL);
sem_destroy(&tsExitSem);
}
}
}