Re: RFR: 8357539: TimeSource.now() is not monotonic [v3]

2025-05-23 Thread Daniel Jeliński
On Fri, 23 May 2025 06:14:37 GMT, Daniel Jeliński wrote: >> We observed a case where the instants returned by `TimeSource.now()` were >> returned in non-monotonic order. The reason was that sometimes we were using >> a delay calculated with one `localSource` as an input to a different >> (upda

Re: RFR: 8357539: TimeSource.now() is not monotonic [v3]

2025-05-23 Thread Daniel Fuchs
On Fri, 23 May 2025 06:14:37 GMT, Daniel Jeliński wrote: >> We observed a case where the instants returned by `TimeSource.now()` were >> returned in non-monotonic order. The reason was that sometimes we were using >> a delay calculated with one `localSource` as an input to a different >> (upda

Re: RFR: 8357539: TimeSource.now() is not monotonic [v3]

2025-05-23 Thread Jaikiran Pai
On Fri, 23 May 2025 06:11:47 GMT, Daniel Jeliński wrote: >> We observed a case where the instants returned by `TimeSource.now()` were >> returned in non-monotonic order. The reason was that sometimes we were using >> a delay calculated with one `localSource` as an input to a different >> (upda

Re: RFR: 8357539: TimeSource.now() is not monotonic [v3]

2025-05-22 Thread Daniel Jeliński
> We observed a case where the instants returned by `TimeSource.now()` were > returned in non-monotonic order. The reason was that sometimes we were using > a delay calculated with one `localSource` as an input to a different (updated > on another thread) `localSource`. This was confirmed by put

Re: RFR: 8357539: TimeSource.now() is not monotonic [v2]

2025-05-22 Thread Jaikiran Pai
On Thu, 22 May 2025 18:56:29 GMT, Daniel Jeliński wrote: >> We observed a case where the instants returned by `TimeSource.now()` were >> returned in non-monotonic order. The reason was that sometimes we were using >> a delay calculated with one `localSource` as an input to a different >> (upda

Re: RFR: 8357539: TimeSource.now() is not monotonic [v2]

2025-05-22 Thread Daniel Fuchs
On Thu, 22 May 2025 18:56:29 GMT, Daniel Jeliński wrote: >> We observed a case where the instants returned by `TimeSource.now()` were >> returned in non-monotonic order. The reason was that sometimes we were using >> a delay calculated with one `localSource` as an input to a different >> (upda

Re: RFR: 8357539: TimeSource.now() is not monotonic [v2]

2025-05-22 Thread Daniel Jeliński
> We observed a case where the instants returned by `TimeSource.now()` were > returned in non-monotonic order. The reason was that sometimes we were using > a delay calculated with one `localSource` as an input to a different (updated > on another thread) `localSource`. This was confirmed by put

Re: RFR: 8357539: TimeSource.now() is not monotonic

2025-05-22 Thread Daniel Jeliński
On Thu, 22 May 2025 10:52:44 GMT, Daniel Fuchs wrote: >> Hello Daniel, with this proposed change, is there any reason to have the >> `localSource` field in this `TimeSource` anymore? > > Yes. It avoids the volatile read on nanoSource. It could serve as a safety net. But I can also revert this a

Re: RFR: 8357539: TimeSource.now() is not monotonic

2025-05-22 Thread Daniel Fuchs
On Thu, 22 May 2025 10:35:57 GMT, Jaikiran Pai wrote: >> src/java.net.http/share/classes/jdk/internal/net/http/common/TimeSource.java >> line 97: >> >>> 95: // use localSource if possible to avoid a volatile read >>> 96: if (source.isInWindow(delay)) { >>> 97: return

Re: RFR: 8357539: TimeSource.now() is not monotonic

2025-05-22 Thread Jaikiran Pai
On Thu, 22 May 2025 09:59:58 GMT, Daniel Fuchs wrote: >> We observed a case where the instants returned by `TimeSource.now()` were >> returned in non-monotonic order. The reason was that sometimes we were using >> a delay calculated with one `localSource` as an input to a different >> (updated

Re: RFR: 8357539: TimeSource.now() is not monotonic

2025-05-22 Thread Daniel Fuchs
On Thu, 22 May 2025 09:53:26 GMT, Daniel Jeliński wrote: > We observed a case where the instants returned by `TimeSource.now()` were > returned in non-monotonic order. The reason was that sometimes we were using > a delay calculated with one `localSource` as an input to a different (updated >

RFR: 8357539: TimeSource.now() is not monotonic

2025-05-22 Thread Daniel Jeliński
We observed a case where the instants returned by `TimeSource.now()` were returned in non-monotonic order. The reason was that sometimes we were using a delay calculated with one `localSource` as an input to a different (updated on another thread) `localSource`. This was confirmed by putting `as