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

Wilfred Spiegelenburg commented on YUNIKORN-1784:
-------------------------------------------------

We need to be really careful with this as changes around DST or skewed times 
that get fixed via NTP could cause all kinds of breakage. Time has a monotonic 
part also not just the wall clock, see [https://pkg.go.dev/time] All 
calculations, like Sub, Since etc, use the monotonic time to prevent these 
kinds of issues. Not sure how we account for that when we use integers.

All calculations like Since and Sub would need to convert _now_ to an integer, 
and we get an integer back. That means we also need to convert all settings to 
integers.
Logging would also show an integer, not that we use it often, but showing real 
timestamps is much clearer there.

> Store time in int64 type instead of time.Time
> ---------------------------------------------
>
>                 Key: YUNIKORN-1784
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1784
>             Project: Apache YuniKorn
>          Issue Type: Sub-task
>          Components: core - scheduler
>            Reporter: Peter Bacsko
>            Assignee: Peter Bacsko
>            Priority: Minor
>
> In various places in Yunikorn, we store time like:
> Application:
> {noformat}
> SubmissionTime       time.Time
> finishedTime         time.Time 
> startTime            time.Time 
> {noformat}
> AllocationLogEntry:
> {noformat}
> LastOccurrence      time.Time
> {noformat}
> AllocationAsk:
> {noformat}
> createTime          time.Time 
> {noformat}
> In the DAO objects, we convert it back to int64 with {{{}Time.UnixNano(){}}}. 
> There are calculations at various places (eg. {{Since()}}, {{Sub()}}), but 
> that's simple to solve.
> Storing a simple int64 is better because not only it consumes less space, 
> {{time.Time}} also contains a pointer to a {{Location}} structure which we 
> don't use.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to