[ 
https://jira.codehaus.org/browse/MNG-5626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=345531#comment-345531
 ] 

Christian Jung edited comment on MNG-5626 at 4/29/14 3:15 AM:
--------------------------------------------------------------

I found a simpler way to reproduce the error: With the following simple script 
i reset the time every few seconds:
{code:timewarp.sh}
#!/bin/bash
while true; do
    date +%T -s "10:13:13"
    sleep 5
    date
done
{code}
(This is linux of course) This produces negative durations in maven. The output 
of {{time maven ...}} is then:
{code}
<snip/>
INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] module1 ........................................... SUCCESS [  0.002 s]
[INFO] module2 ........................................... SUCCESS [  0.000 s]
[INFO] gpPlaygroundBase-lnx-x86-gcc4 ..................... SUCCESS [-2.-497 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: -1.-774 s
[INFO] Finished at: 2014-04-29T10:13:14+01:00
[INFO] Final Memory: 17M/310M
[INFO] ------------------------------------------------------------------------

real    0m0.000s
user    0m6.148s
sys     0m0.996s
{code}
It seems that {{time}} does not display any negative times.


was (Author: christian.jung):
I found a simpler way to reproduce the error: With the following simple script 
i reset the time every few seconds:
{code:timewarp.sh}
#!/bin/bash
while true; do
    date +%T -s "10:13:13"
    sleep 5
    date
done
{code}
(This is linux of course) This produces negative durations in maven. The output 
of {{time maven ...}} is then:
{code}
<snip/>
INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] module1 ........................................... SUCCESS [  0.002 s]
[INFO] module2 ........................................... SUCCESS [  0.000 s]
[INFO] gpPlaygroundBase-lnx-x86-gcc4 ..................... SUCCESS [-2.-497 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: -1.-774 s
[INFO] Finished at: 2014-04-29T10:13:14+01:00
[INFO] Final Memory: 17M/310M
[INFO] ------------------------------------------------------------------------

real    0m0.000s
user    0m6.148s
sys     0m0.996s
{code}
It seems that time does not display any negative times.

> Avoid negative durations or handle them correctly
> -------------------------------------------------
>
>                 Key: MNG-5626
>                 URL: https://jira.codehaus.org/browse/MNG-5626
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Logging
>    Affects Versions: 3.2.1
>            Reporter: Christian Jung
>            Priority: Minor
>
> In issue MNG-5623 we reported an exception when printing the reactor summary 
> if one of the times was negative.
> I saw in one case, that the overall maven build time, as measured from 
> outside (i.e. by our QuickBuild system) was -10.8 seconds. The corresponding 
> reactor summary was:
> {code}
> 13:55:25,184 INFO  - Reactor Summary:
> 13:55:25,184 INFO  -
> 13:55:25,184 INFO  - module1 ........................................... 
> SUCCESS [ 5.911 s]
> 13:55:25,184 INFO  - module2 ........................................... 
> SUCCESS [ 0.255 s]
> 13:55:25,184 INFO  - gpPlaygroundBase-lnx-x64-gcc4 ..................... 
> SUCCESS [-27.-64 s]
> 13:55:25,185 INFO  - 
> ------------------------------------------------------------------------
> 13:55:25,185 INFO  - BUILD SUCCESS
> 13:55:25,185 INFO  - 
> ------------------------------------------------------------------------
> 13:55:25,185 INFO  - Total time: -20.-73 s
> 13:55:25,185 INFO  - Finished at: 2014-04-28T13:55:25+01:00
> 13:55:25,572 INFO  - Final Memory: 32M/439M
> 13:55:25,572 INFO  - 
> ------------------------------------------------------------------------
> {code}
> The thing is quite hard to reproduce, the machines were virtual machines that 
> have been running for quite a long time.
> Our administrators suspected that just at this point, the local clock was 
> synchronized with some outer source.
> We should check if such negative durations can be avoided, and if not, they 
> should be handled correctly.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to