You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Ignite TC Bot (JIRA)" <ji...@apache.org> on 2019/02/12 17:41:00 UTC

[jira] [Commented] (IGNITE-11288) TcpDiscovery deadlock on SSLSocket.close().

    [ https://issues.apache.org/jira/browse/IGNITE-11288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16766281#comment-16766281 ] 

Ignite TC Bot commented on IGNITE-11288:
----------------------------------------

{panel:title=--&gt; Run :: All: No blockers found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
[TeamCity *--&gt; Run :: All* Results|https://ci.ignite.apache.org/viewLog.html?buildId=3068187&amp;buildTypeId=IgniteTests24Java8_RunAll]

> TcpDiscovery deadlock on SSLSocket.close().
> -------------------------------------------
>
>                 Key: IGNITE-11288
>                 URL: https://issues.apache.org/jira/browse/IGNITE-11288
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Pavel Voronkin
>            Assignee: Pavel Voronkin
>            Priority: Critical
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Rootcause is we not set SO_TIMEOUT on discovery socket on retry:
> RingMessageWorker: 3152 sock = spi.openSocket(addr, timeoutHelper);
> So ring message worker blocks forever but SSLSOcketImpl.close() onTimeout hangs on writeLock. 
>  
> According to java8 SSLSocketImpl:
> {code}
> if (var1.isAlert((byte)0) && this.getSoLinger() >= 0) {
>  boolean var3 = Thread.interrupted();
> try {
>  if (this.writeLock.tryLock((long)this.getSoLinger(), TimeUnit.SECONDS)) {
>  try
> { this.writeRecordInternal(var1, var2); }
>  
>  finally \{ this.writeLock.unlock(); }
>  } else
>  
>  \{ SSLException var4 = new SSLException("SO_LINGER timeout, close_notify message cannot be sent."); if (this.isLayered() && !this.autoClose) { this.fatal((byte)-1, (Throwable)var4); }
>  
>  else if (debug != null && Debug.isOn("ssl")) \{ System.out.println(Thread.currentThread().getName() + ", received Exception: " + var4); }
>  
>  this.sess.invalidate();
>  }
>  } catch (InterruptedException var14) \{ var3 = true; }
>  
>  if (var3) \{ Thread.currentThread().interrupt(); }
>  } else
>  
>  \{ this.writeLock.lock(); try { this.writeRecordInternal(var1, var2); }
> finally
> { this.writeLock.unlock(); }
> }
>  {code}
> In case of soLinger is not set we fallback to this.writeLock.lock(); which wait forever, cause RingMessageWorker is writing message with SO_TIMEOUT zero.
> U.closeQuiet(socket) if SSL is on will hang if soLinger() is negative.
>  
> Solution:
> 1) Set proper SO_TIMEOUT
> 2) Possibly add ability to override SO_LINGER to some reasonable value.
>  
> Similar bug [https://bugs.openjdk.java.net/browse/JDK-6668261].
>  



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