vldpyatkov commented on code in PR #2003:
URL: https://github.com/apache/ignite-3/pull/2003#discussion_r1183378095


##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java:
##########
@@ -395,4 +407,54 @@ private boolean isLeaseOutdated(Lease lease) {
             return now.after(lease.getExpirationTime());
         }
     }
+
+    /**
+     * Message handler to process notification from replica side.
+     */
+    private class PlacementDriverActorMessageHandler implements 
NetworkMessageHandler {
+        @Override
+        public void onReceived(NetworkMessage msg0, String sender, @Nullable 
Long correlationId) {
+            if (!(msg0 instanceof PlacementDriverActorMessage)) {
+                return;
+            }
+
+            var msg = (PlacementDriverActorMessage) msg0;
+
+            if (!stateActorLock.enterBusy()) {
+                return;
+            }
+
+            try {
+                processMessageInternal(sender, msg);
+            } finally {
+                stateActorLock.leaveBusy();
+            }
+        }
+
+        /**
+         * Processes an placement driver actor message. The method should be 
invoked under state lock.
+         *
+         * @param sender Sender node name.
+         * @param msg Message.
+         */
+        private void processMessageInternal(String sender, 
PlacementDriverActorMessage msg) {
+            ReplicationGroupId grpId = msg.groupId();
+
+            Lease lease = leaseTracker.getLease(grpId);
+
+            if (msg instanceof StopLeaseProlongationMessage) {
+                if (lease.isProlong() && 
sender.equals(lease.getLeaseholder().name())) {

Review Comment:
   Renamed.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to