[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mina-dev
Subject:    [jira] [Commented] (DIRMINA-1093) Ignore SME just like CNFE while checking deadlock in DefaultIoFutu
From:       "Yogesh Gaikwad (JIRA)" <jira () apache ! org>
Date:       2018-09-20 4:03:00
Message-ID: JIRA.13183970.1536568136000.116193.1537416180264 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/DIRMINA-1093?page=com.atlassian.jira.plugi \
n.system.issuetabpanels:comment-tabpanel&focusedCommentId=16621485#comment-16621485 ] \


Yogesh Gaikwad commented on DIRMINA-1093:
-----------------------------------------

Hi Emmanuel, I have uploaded the patch. Thank you!

> Ignore SME just like CNFE while checking deadlock in DefaultIoFuture
> --------------------------------------------------------------------
> 
> Key: DIRMINA-1093
> URL: https://issues.apache.org/jira/browse/DIRMINA-1093
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0.17, 2.0.18, 2.0.19
> Environment: Applicable to all platforms
> Reporter: Yogesh Gaikwad
> Priority: Major
> Labels: easyfix
> Attachments: DIRMINA-1093.patch
> 
> 
> The problem occurs when we have a security manager enabled with restrictions.
> After writing a request to \
> [LdapNetworkConnection|https://github.com/apache/directory-ldap-api/blob/52129503d7f \
> 2247bad4a5f73b234023b8158ff07/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java#L4934], \
> we wait for the completion of the  request. For every \
> {code:java}writeFuture.awaitUninterruptibly{code} it checks for deadlock \
> [DefaultIoFuture|https://mina.apache.org/mina-project/apidocs/src-html/org/apache/mina/core/future/DefaultIoFuture.html]#checkDeadLock() \
> which is code that requires security permissions and throws following exception: \
> {code:java}java.security.AccessControlException: access denied \
> ("java.lang.RuntimePermission" "accessClassInPackage.sun.reflect"){code} A proposed \
> solution would be to ignore Java security manager exception (SME) similar to Class \
> not found exception(CNFE). For CNFE, we ignore the exception and continue as we are \
> just testing for deadlocks. {code:java}
> for (StackTraceElement s : stackTrace) {
> try {
> Class<?> cls = DefaultIoFuture.class.getClassLoader().loadClass(s.getClassName());
> 
> if (IoProcessor.class.isAssignableFrom(cls)) {
> throw new IllegalStateException("DEAD LOCK: " + IoFuture.class.getSimpleName()
> + ".await() was invoked from an I/O processor thread.  " + "Please use "
> + IoFutureListener.class.getSimpleName()
> + " or configure a proper thread model alternatively.");
> }
> } catch (ClassNotFoundException cnfe) {
> // Ignore
> }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic