Github user paul-guo- commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1223#discussion_r113598189
--- Diff: src/backend/resourcemanager/utils/network_utils.c ---
@@ -41,9 +42,23 @@ static void cleanupSocketConnectionPool(int code, Datum
arg);
uint64_t gettime_microsec(void)
{
- static struct timeval t;
- gettimeofday(&t,NULL);
- return 1000000ULL * t.tv_sec + t.tv_usec;
+ struct timeval newTime;
+ int status = 1;
+ uint64_t t = 0;
+
+#if HAVE_LIBRT
+ struct timespec ts;
+ status = clock_gettime(CLOCK_MONOTONIC, &ts);
+ newTime.tv_sec = ts.tv_sec;
+ newTime.tv_usec = ts.tv_nsec / 1000;
+#endif
+
+ if (status != 0)
+ {
+ gettimeofday(&newTime, NULL);
+ }
+ t = ((uint64_t)newTime.tv_sec) * USECS_PER_SECOND + newTime.tv_usec;
+ return t;
--- End diff --
spaces -> tab.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---