@@ -1076,7 +1076,9 @@ private void retireLease(PooledSender ps, String context) {
10761076 pendingLeaseTeardowns --;
10771077 if (reserved ) {
10781078 // Free the index only when the flock was released; a slot
1079- // left locked is retired permanently.
1079+ // left locked is retired into retiredSlots, recoverable
1080+ // by reprobeRetiredSlots() if the deferred cleanup drops
1081+ // the flock later.
10801082 reclaimSlot (s , context );
10811083 }
10821084 slotReleased .signalAll ();
@@ -1364,10 +1366,13 @@ private static boolean flockReleased(SenderSlot s) {
13641366 * Reclaims one SF slot after its delegate's {@code close()} has been
13651367 * attempted. When the flock was released the index returns to the free
13661368 * set; when {@code close()} returned with the flock still held because an
1367- * I/O or manager worker did not stop, the slot is retired permanently --
1368- * {@code leakedSlots++} and {@code slotInUse[idx]} stays set -- so the cap
1369- * math accounts for the lost capacity and no later borrow ever reuses the
1370- * still-locked dir. Either way {@code closingSlots} is decremented.
1369+ * I/O or manager worker did not stop, the slot is retired --
1370+ * {@code leakedSlots++}, {@code slotInUse[idx]} stays set, and the sender
1371+ * joins {@code retiredSlots} -- so the cap math accounts for the lost
1372+ * capacity and no borrow reuses the still-locked dir unless
1373+ * {@link #reprobeRetiredSlots} later observes the deferred cleanup's
1374+ * release and recovers the index. Either way {@code closingSlots} is
1375+ * decremented.
13711376 * <p>
13721377 * Caller must hold {@code lock} and is responsible for signalling waiters
13731378 * (only the free path admits a new creation). Shared by
0 commit comments