openshift / jenkins-plugin

Apache License 2.0
81 stars 50 forks source link

Replace use of System.currentTimeMillis() #76

Closed jupierce closed 7 years ago

jupierce commented 8 years ago

currentTimeMillis() is impacted by system clock changes (e.g. daylight savings changes). This can cause wait time calculations relying on the API to behave incorrectly. These loops can be changed to use System.nanoTime() (with changes to accommodate nanoseconds instead of milliseconds values).

gabemontero commented 8 years ago

Interesting. Ok, we'll add to the list. I'll defer on assignment until the dust settles on all the concurrent work that is going on.

bparees commented 7 years ago

@jupierce i assume you used nanotime in the new plugin implementation?

jupierce commented 7 years ago

@bparees The new plugin shouldn't have this exposure. There are few timing loops in general because I expected users to use the base Jenkins "timeout" DSL or the timeout freestyle step wrapper. The plugin's step implementations just need to be interruptible (and should already be) in order to inherit the base timeout features.

gabemontero commented 7 years ago

This will be in v1.0.42 of the plugin.