apoorvmittal10 commented on code in PR #19500:
URL: https://github.com/apache/kafka/pull/19500#discussion_r2052247183


##########
server/src/main/java/org/apache/kafka/server/share/session/ShareSessionCache.java:
##########
@@ -122,15 +113,9 @@ public synchronized ShareSession remove(ShareSession 
session) {
      * Update a session's position in the lastUsed tree.
      *
      * @param session  The session.
-     * @param now      The current time in milliseconds.
      */
-    public synchronized void touch(ShareSession session, long now) {
+    public synchronized void updateNumPartitions(ShareSession session) {
         synchronized (session) {

Review Comment:
   There is a read and update to the `session`,  to make the operation atomic 
over ShareSession hence the sync block was applied here. The individual methods 
sync can guarantee an updated value value read but overall the operation is not 
atomic if we miss the sync block here. Am I missing something?



-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to