TheRoddyWMS / BatchEuphoria

A library to access different kinds of cluster backends
MIT License
3 stars 5 forks source link

Explain/Fix weird behaviour of LSFJobManager.parseTime() #134

Closed dankwart-de closed 5 years ago

dankwart-de commented 5 years ago

In:

    private ZonedDateTime parseTime(String str) {
        ZonedDateTime date = ZonedDateTime.parse("${str} ${LocalDateTime.now().getYear()}", DATE_PATTERN)
        if (date > ZonedDateTime.now()) {
            return date.minusYears(1)
        }
        return date
    }

can you please explain, why you subtract one! year of date, when the reported date is greater than the local! date? In my opinion, a computers local date can (and will) differ from the date on other computers. E.g. I have a VM which will not refresh its time, when I suspend and resume it.

vinjana commented 5 years ago

LSF does not return the year of submission (or whatever). The assumption here is that if the time parsed under the assumption of the current year is later than the current time, then the job correct date must have been in the last year. As LSF does not return the actual year, this is the least problematic assumption.

dankwart-de commented 5 years ago

Thanks! I saw, that you already commented it in #135. I close it now.