[ 
https://issues.apache.org/jira/browse/PROTON-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16963930#comment-16963930
 ] 

ASF GitHub Bot commented on PROTON-2030:
----------------------------------------

alanconway commented on pull request #180: PROTON-2030 Use CLOCK_MONOTONIC in 
proactors for pn_transport_tick
URL: https://github.com/apache/qpid-proton/pull/180#discussion_r341102642
 
 

 ##########
 File path: c/src/proactor/epoll.c
 ##########
 @@ -1426,10 +1419,10 @@ static void pconnection_tick(pconnection_t *pc) {
   pn_transport_t *t = pc->driver.transport;
   if (pn_transport_get_idle_timeout(t) || 
pn_transport_get_remote_idle_timeout(t)) {
     ptimer_set(&pc->timer, 0);
-    uint64_t now = pn_i_now2();
-    uint64_t next = pn_transport_tick(t, now);
+    int64_t now = pn_proactor_now_64();
+    int64_t next = pn_transport_tick(t, now);
     if (next) {
-      ptimer_set(&pc->timer, next - now);
+      ptimer_set(&pc->timer, (uint64_t) next - now);
     }
 
 Review comment:
   Signed arithmetic is a lot easier in general, since you can have negative 
intermediate results in an expression, and express offsets in both directions 
in a straightforward way. I'd prefer signed in the public API  unless there's a 
massively good reason to go unsigned. Overflow in 34,000,000,000 years instead 
of 17,000,000,000 years  doesn't strike me as a massively good reason, although 
obviously programmers in the year 17,000,001,969 will curse my 
short-sightedness. Trust Andrew to be considerate of the hyper-intelligent 
horseshoe-crabs that will be masters of the planet then.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Use CLOCK_MONOTONIC in proactors for pn_transport_tick
> ------------------------------------------------------
>
>                 Key: PROTON-2030
>                 URL: https://issues.apache.org/jira/browse/PROTON-2030
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: proton-c
>    Affects Versions: proton-c-0.27.0
>            Reporter: Jiri Daněk
>            Priority: Major
>
> IOCP and epoll proactors are feeding wall clock time to pn_transport_tick. I 
> tested (with epoll) that changing system clock breaks heartbeating.
> The libuv proactor does use monotonic already.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to