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

Otavio Rodolfo Piske commented on CAMEL-20655:
----------------------------------------------

Hey Claus, I tried reproducing the problem, but I was unable to:

 
{code:java}
2024-04-07 18:42:53.140  INFO 2225288 --- [ownCamelContext] 
el.impl.engine.AbstractCamelContext : Apache Camel 4.6.0-SNAPSHOT (Foo) 
shutdown in 35ms (uptime: 4h0m or 14402348 milliseconds in total)

{code}
 

 

Did this happen on your laptop or a desktop?

I'm wondering if what you experienced could be because, at some point, the 
system entered sleep mode. If you were running this on your laptop, this could 
have been the case.

Java's 
[nanoTime|https://github.com/openjdk/jdk/blob/d1aad71209092013a89b3b85a258dd4d2e31224a/src/hotspot/os/posix/os_posix.cpp#L1412]
 is implemented on top of 
[clock_gettime(CLOCK_MONOTONIC)|https://www.man7.org/linux/man-pages/man3/clock_gettime.3.html]
 on Linux and 
[mach_absolute_time|https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time]
 on macOS (both of which do not increment while the system is asleep/suspended.

> camel-core - Uptime is that accurate on shutdown
> ------------------------------------------------
>
>                 Key: CAMEL-20655
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20655
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Otavio Rodolfo Piske
>            Priority: Minor
>
> I have an app running locally for almost 4 hours, but the uptime logged on 
> shutdown says 3h and 18 minutes.
> {code}
> ~/workspace/deleteme ❯ camel run rest.camel.yaml
> 2024-04-05 09:10:56.376  INFO 1874 --- [           main] 
> org.apache.camel.main.MainSupport   : Apache Camel (JBang) 4.6.0-SNAPSHOT is 
> starting
> 2024-04-05 09:10:56.485  INFO 1874 --- [           main] 
> org.apache.camel.main.MainSupport   : Using Java 17.0.5 with PID 1874. 
> Started by davsclaus in /Users/davsclaus/workspace/deleteme
> 2024-04-05 09:10:56.567  INFO 1874 --- [           main] 
> apache.camel.main.ProfileConfigurer : The application is starting with 
> profile: dev
> 2024-04-05 09:10:57.046  INFO 1874 --- [           main] 
> mel.cli.connector.LocalCliConnector : Camel JBang CLI enabled
> 2024-04-05 09:10:57.110  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext : Apache Camel 4.6.0-SNAPSHOT (rest) is 
> starting
> 2024-04-05 09:10:57.233  INFO 1874 --- [           main] 
> .core.spi.resolver.ResolverProvider : Using the default address resolver as 
> the dns resolver could not be loaded
> 2024-04-05 09:10:57.312  INFO 1874 --- [ntloop-thread-0] 
> .http.vertx.VertxPlatformHttpServer : Vert.x HttpServer started on 
> 0.0.0.0:8080
> 2024-04-05 09:10:57.712  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext : Routes startup (total:2 rest-dsl:2)
> 2024-04-05 09:10:57.712  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext :     Started route1 (rest-api://api-doc)
> 2024-04-05 09:10:57.712  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext :     Started dummy 
> (rest://get:abc:%7Bid%7D)
> 2024-04-05 09:10:57.712  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext : Apache Camel 4.6.0-SNAPSHOT (rest) 
> started in 601ms (build:0ms init:0ms start:601ms)
> 2024-04-05 09:10:57.713  INFO 1874 --- [           main] 
> t.platform.http.main.MainHttpServer : HTTP endpoints summary
> 2024-04-05 09:10:57.714  INFO 1874 --- [           main] 
> t.platform.http.main.MainHttpServer :     http://0.0.0.0:8080/abc/{id}    
> (GET)    (accept:application/json produce:application/json)
> 2024-04-05 09:10:57.714  INFO 1874 --- [           main] 
> t.platform.http.main.MainHttpServer :     http://0.0.0.0:8080/api-doc     
> (GET)    (produce:application/json,text/yaml)
> ^C2024-04-05 13:02:13.519  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext : Apache Camel 4.6.0-SNAPSHOT (rest) is 
> shutting down (timeout:10s)
> 2024-04-05 13:02:13.530  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext : Routes stopped (total:2 rest-dsl:2)
> 2024-04-05 13:02:13.531  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext :     Stopped dummy 
> (rest://get:abc:%7Bid%7D)
> 2024-04-05 13:02:13.531  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext :     Stopped route1 (rest-api://api-doc)
> 2024-04-05 13:02:13.537  INFO 1874 --- [ntloop-thread-0] 
> .http.vertx.VertxPlatformHttpServer : Vert.x HttpServer stopped
> 2024-04-05 13:02:13.542  INFO 1874 --- [           main] 
> el.impl.engine.AbstractCamelContext : Apache Camel 4.6.0-SNAPSHOT (rest) 
> shutdown in 23ms (uptime:3h18m)
> 2024-04-05 13:02:13.542  INFO 1874 --- [           main] 
> org.apache.camel.main.MainSupport   : Apache Camel (JBang) 4.6.0-SNAPSHOT 
> shutdown
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to