Explorar o código

ZOOKEEPER-1622. session ids will be negative in the year 2022 (Eric Newton via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1551119 13f79535-47bb-0310-9956-ffa450edef68
Patrick D. Hunt %!s(int64=11) %!d(string=hai) anos
pai
achega
f271dac9f9

+ 3 - 0
CHANGES.txt

@@ -498,6 +498,9 @@ BUGFIXES:
 
   ZOOKEEPER-1839. Deadlock in NettyServerCnxn (Rakesh R via michim)
 
+  ZOOKEEPER-1622. session ids will be negative in the year 2022
+  (Eric Newton via phunt)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

+ 1 - 1
src/java/main/org/apache/zookeeper/server/SessionTrackerImpl.java

@@ -75,7 +75,7 @@ public class SessionTrackerImpl extends Thread implements SessionTracker {
      */
     public static long initializeNextSession(long id) {
         long nextSid = 0;
-        nextSid = (System.currentTimeMillis() << 24) >> 8;
+        nextSid = (System.currentTimeMillis() << 24) >>> 8;
         nextSid =  nextSid | (id <<56);
         return nextSid;
     }