提交 4e9bfcbd 编写于 作者: R robm

7174887: Deadlock in jndi ldap connection cleanup

Reviewed-by: xuelei
上级 f698a8d9
/* /*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -680,9 +680,11 @@ public final class Connection implements Runnable { ...@@ -680,9 +680,11 @@ public final class Connection implements Runnable {
ldr = ldr.next; ldr = ldr.next;
} }
} }
parent.processConnectionClosure();
} }
} }
if (nparent) {
parent.processConnectionClosure();
}
} }
......
/* /*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -488,14 +488,16 @@ public final class LdapClient implements PooledConnection { ...@@ -488,14 +488,16 @@ public final class LdapClient implements PooledConnection {
*/ */
void processConnectionClosure() { void processConnectionClosure() {
// Notify listeners // Notify listeners
if (unsolicited.size() > 0) { synchronized (unsolicited) {
String msg; if (unsolicited.size() > 0) {
if (conn != null) { String msg;
msg = conn.host + ":" + conn.port + " connection closed"; if (conn != null) {
} else { msg = conn.host + ":" + conn.port + " connection closed";
msg = "Connection closed"; } else {
msg = "Connection closed";
}
notifyUnsolicited(new CommunicationException(msg));
} }
notifyUnsolicited(new CommunicationException(msg));
} }
// Remove from pool // Remove from pool
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册