You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Calvin MongoDB (Jira)" <ji...@apache.org> on 2024/12/06 18:23:00 UTC
[jira] [Created] (KAFKA-18175) Breaking change for SystemTime usages
Calvin MongoDB created KAFKA-18175:
--------------------------------------
Summary: Breaking change for SystemTime usages
Key: KAFKA-18175
URL: https://issues.apache.org/jira/browse/KAFKA-18175
Project: Kafka
Issue Type: Bug
Affects Versions: 3.9.0
Reporter: Calvin MongoDB
Kafka version 3.9 introduced a breaking change by disallowing SystemTime instantiations.
https://issues.apache.org/jira/browse/KAFKA-16879
To quote the original ticket KAFKA-16879
> Howerver, system time is unique,In an application, the time obtained in different places should be consistent, But now the time obtained by using the Java System class to interact with the underlying layer is the same。
I'm not sure we should have introduced a breaking change for these reasons. Also, why do we believe that the time would be different across instantiations of `new SystemTime()` if under the hood they're only calling System methods `return System.currentTimeMillis();`?
Additionally, I suspect that forcing the singleton pattern with SystemTime might also negatively impact usage patterns around `waitObject`, what if someone wants to have multiple waitObject calls running in parallel? Which they would only be able to do with separate instantiations of SystemTime.
From MongoDB's perspective it is a fairly simple change for us to just go ahead and reference the singleton, but I just wanted to callout that I suspect this may cause more issues for others.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)