static long calculateDeadlineMs(final long currentTimeMs, final long timeoutMs) {
        if (currentTimeMs > Long.MAX_VALUE - timeoutMs)
            return Long.MAX_VALUE;
        else
            return currentTimeMs + timeoutMs;
    }
Calculate the deadline timestamp based on the current time and timeout.

@param currentTimeMs Current time, in milliseconds
@param timeoutMs     Timeout, in milliseconds

@return Absolute time by which event should be completed
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/CompletableEvent.java