|
1 | 1 |
|
2 | 2 | /*
|
3 |
| - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. |
| 3 | + * Copyright (c) 2000, 2025, Oracle and/or its affiliates. |
4 | 4 | *
|
5 | 5 | * Licensed under the Universal Permissive License v 1.0 as shown at
|
6 | 6 | * https://oss.oracle.com/licenses/upl.
|
@@ -157,7 +157,16 @@ public class Connection
|
157 | 157 | * @see com.tangosol.net.messaging.Connection#getPeerId
|
158 | 158 | */
|
159 | 159 | private com.tangosol.util.UUID __m_PeerId;
|
160 |
| - |
| 160 | + |
| 161 | + /** |
| 162 | + * Property PendingCloses |
| 163 | + * |
| 164 | + * The number of outstanding pending close requests. |
| 165 | + * |
| 166 | + * @see com.tangosol.net.messaging.Connection#getPendingCloses |
| 167 | + */ |
| 168 | + private volatile int __m_PendingCloses; |
| 169 | + |
161 | 170 | /**
|
162 | 171 | * Property PingLastMillis
|
163 | 172 | *
|
@@ -504,8 +513,10 @@ public void close(boolean fNotify, Throwable e, boolean fWait)
|
504 | 513 | {
|
505 | 514 | // import Component.Util.Daemon.QueueProcessor.Service.Peer as com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer;
|
506 | 515 |
|
507 |
| - if (isOpen()) |
| 516 | + if (isOpen() && getPendingCloses() < MAX_PENDING) |
508 | 517 | {
|
| 518 | + setPendingCloses(getPendingCloses() + 1); |
| 519 | + |
509 | 520 | com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer manager = (com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer) getConnectionManager();
|
510 | 521 | if (Thread.currentThread() == manager.getThread())
|
511 | 522 | {
|
@@ -1016,7 +1027,17 @@ public com.tangosol.util.UUID getPeerId()
|
1016 | 1027 | {
|
1017 | 1028 | return __m_PeerId;
|
1018 | 1029 | }
|
1019 |
| - |
| 1030 | + |
| 1031 | + // Accessor for the property "PendingCloses" |
| 1032 | + /** |
| 1033 | + * Getter for property PendingCloses.<p> |
| 1034 | + * The number of outstanding pending close requests. |
| 1035 | + */ |
| 1036 | + public int getPendingCloses() |
| 1037 | + { |
| 1038 | + return __m_PendingCloses; |
| 1039 | + } |
| 1040 | + |
1020 | 1041 | // Accessor for the property "PingLastMillis"
|
1021 | 1042 | /**
|
1022 | 1043 | * Getter for property PingLastMillis.<p>
|
@@ -1658,7 +1679,17 @@ public void setPeerId(com.tangosol.util.UUID uuid)
|
1658 | 1679 | {
|
1659 | 1680 | __m_PeerId = uuid;
|
1660 | 1681 | }
|
1661 |
| - |
| 1682 | + |
| 1683 | + // Accessor for the property "PendingCloses" |
| 1684 | + /** |
| 1685 | + * Setter for property PendingCloses.<p> |
| 1686 | + * The number of outstanding pending close requests. |
| 1687 | + */ |
| 1688 | + public void setPendingCloses(int nCloses) |
| 1689 | + { |
| 1690 | + __m_PendingCloses = nCloses; |
| 1691 | + } |
| 1692 | + |
1662 | 1693 | // Accessor for the property "PingLastMillis"
|
1663 | 1694 | /**
|
1664 | 1695 | * Setter for property PingLastMillis.<p>
|
|
0 commit comments