Before the change ubsan would assert on a signed integer overflow
/vectorized/llvm/bin/../include/c++/v1/__chrono/duration.h:92:79: runtime error: signed integer overflow: 9223372036854775807 * 1000 cannot be represented in type '_Ct' (aka 'long long')
cluster::tx::producer_state_manager::evict_excess_producers() at /vectorized/llvm/bin/../include/c++/v1/__chrono/duration.h:92
The problem lies in that we try to subtract duration from a time_point with microsecond granularity. When doing that, duration is converted to a common type, microsecond representation and the millisecond::max() being already maximum value that can be represented in a long long can't be converted to micros (multiplied by 1000).
Not sure if this is the perfect fix but avoid the problem by initializing the duration with a value that can be later represented as micros.
Backports Required
[x] none - not a bug fix
[ ] none - this is a backport
[ ] none - issue does not exist in previous branches
[ ] none - papercut/not impactful enough to backport
Before the change ubsan would assert on a signed integer overflow
The problem lies in that we try to subtract duration from a time_point with microsecond granularity. When doing that, duration is converted to a common type, microsecond representation and the millisecond::max() being already maximum value that can be represented in a long long can't be converted to micros (multiplied by 1000).
Not sure if this is the perfect fix but avoid the problem by initializing the duration with a value that can be later represented as micros.
Backports Required
Release Notes
none
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/58103#0193305c-1c02-432c-bf0a-2935674c71e5