Skip to content

Commit a7ee0dd

Browse files
committed
Bug 37871569 - [37331397->22.06.13] RFA: Proxy not cleaning closed connections fast enough to avoid OOME.
[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v22.06/": change = 115916]
1 parent 6fa70de commit a7ee0dd

File tree

1 file changed

+36
-5
lines changed
  • prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/net/extend

1 file changed

+36
-5
lines changed

prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/net/extend/Connection.java

+36-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
3+
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
44
*
55
* Licensed under the Universal Permissive License v 1.0 as shown at
66
* https://oss.oracle.com/licenses/upl.
@@ -157,7 +157,16 @@ public class Connection
157157
* @see com.tangosol.net.messaging.Connection#getPeerId
158158
*/
159159
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+
161170
/**
162171
* Property PingLastMillis
163172
*
@@ -504,8 +513,10 @@ public void close(boolean fNotify, Throwable e, boolean fWait)
504513
{
505514
// import Component.Util.Daemon.QueueProcessor.Service.Peer as com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer;
506515

507-
if (isOpen())
516+
if (isOpen() && getPendingCloses() < MAX_PENDING)
508517
{
518+
setPendingCloses(getPendingCloses() + 1);
519+
509520
com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer manager = (com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer) getConnectionManager();
510521
if (Thread.currentThread() == manager.getThread())
511522
{
@@ -1016,7 +1027,17 @@ public com.tangosol.util.UUID getPeerId()
10161027
{
10171028
return __m_PeerId;
10181029
}
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+
10201041
// Accessor for the property "PingLastMillis"
10211042
/**
10221043
* Getter for property PingLastMillis.<p>
@@ -1658,7 +1679,17 @@ public void setPeerId(com.tangosol.util.UUID uuid)
16581679
{
16591680
__m_PeerId = uuid;
16601681
}
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+
16621693
// Accessor for the property "PingLastMillis"
16631694
/**
16641695
* Setter for property PingLastMillis.<p>

0 commit comments

Comments
 (0)