mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-25 01:30:10 +00:00
7174887: Deadlock in jndi ldap connection cleanup
Reviewed-by: xuelei
This commit is contained in:
parent
826591b516
commit
2a72b6a15f
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -680,9 +680,11 @@ public final class Connection implements Runnable {
|
||||
ldr = ldr.next;
|
||||
}
|
||||
}
|
||||
parent.processConnectionClosure();
|
||||
}
|
||||
}
|
||||
if (nparent) {
|
||||
parent.processConnectionClosure();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -488,14 +488,16 @@ public final class LdapClient implements PooledConnection {
|
||||
*/
|
||||
void processConnectionClosure() {
|
||||
// Notify listeners
|
||||
if (unsolicited.size() > 0) {
|
||||
String msg;
|
||||
if (conn != null) {
|
||||
msg = conn.host + ":" + conn.port + " connection closed";
|
||||
} else {
|
||||
msg = "Connection closed";
|
||||
synchronized (unsolicited) {
|
||||
if (unsolicited.size() > 0) {
|
||||
String msg;
|
||||
if (conn != null) {
|
||||
msg = conn.host + ":" + conn.port + " connection closed";
|
||||
} else {
|
||||
msg = "Connection closed";
|
||||
}
|
||||
notifyUnsolicited(new CommunicationException(msg));
|
||||
}
|
||||
notifyUnsolicited(new CommunicationException(msg));
|
||||
}
|
||||
|
||||
// Remove from pool
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user