You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/08/24 21:08:33 UTC

[GitHub] [cassandra] maedhroz commented on a change in pull request #716: Cassandra 16064

maedhroz commented on a change in pull request #716:
URL: https://github.com/apache/cassandra/pull/716#discussion_r475895181



##########
File path: src/java/org/apache/cassandra/net/Message.java
##########
@@ -695,7 +695,7 @@ private Header deserializeHeaderPost40(DataInputPlus in, InetAddressAndPort peer
             long currentTimeNanos = approxTime.now();
             MonotonicClockTranslation timeSnapshot = approxTime.translate();
             long creationTimeNanos = calculateCreationTimeNanos(in.readInt(), timeSnapshot, currentTimeNanos);
-            long expiresAtNanos = getExpiresAtNanos(creationTimeNanos, currentTimeNanos, TimeUnit.MILLISECONDS.toNanos(in.readUnsignedVInt()));
+            long expiresAtNanos = getExpiresAtNanos(creationTimeNanos, currentTimeNanos, TimeUnit.MILLISECONDS.toNanos(in.readUnsignedVInt() - 1));

Review comment:
       I think allowing zero for the result of `NANOSECONDS.toMillis(header.expiresAtNanos - header.createdAtNanos)` at serialization time (without the +1) might not write a sensible vint.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org