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

Benoit Tellier commented on JAMES-3613:
---------------------------------------

To be noted: this MDC context is re-computed for *each and every message* 
leading to one DNS resolution per message received...

Which likely means the above specified limit could be hit with just a few big 
messages and no JVM local DNS cache.

I bet we should rather :
 - Compute the MDC builder upon establishing the connection
 - Save it as a netty connection attachment
 - reuse it for follow up messages...

This would prevent multiple MDC recomputation and should be fixing the issue 
too.

> Avoid DNS resolution for protocol MDC context
> ---------------------------------------------
>
>                 Key: JAMES-3613
>                 URL: https://issues.apache.org/jira/browse/JAMES-3613
>             Project: James Server
>          Issue Type: Improvement
>          Components: IMAPServer, POP3Server, SMTPServer
>    Affects Versions: 3.4.0, 3.5.0, 3.6.0
>            Reporter: Benoit Tellier
>            Priority: Major
>             Fix For: 3.7.0
>
>
> On gitter: {code:java}
> Running into an odd issue after an application restart. (James 3.4.0 running 
> in SpringBoot application). Was working fine, but now seem to be getting 
> hung, or at least slow threads, on java.net.Inet6AddressImpl.getHostByAddr as 
> called by 
> org.apache.james.protocols.netty.ProtocolMDCContext.retrieveHost(ProtocolMDCContext.java:55).
>  My environment is Java 11, on Amazon Linux 2, on EC2. 
> {code}
> https://gist.github.com/devondragon/8ec7424a48dc843338443b0b98356289
> this seems to have been caused by too many incoming SMTP connections. Showed 
> up in an odd way, but by decreasing the inbound connections this issue has 
> stopped happening...
> Likely some rate limit on DNS resolution. 
> Proposal: switch from `getHostName` to `getHostString` to prevent the DNS 
> resolution.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to