Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-3613

Avoid DNS resolution for protocol MDC context

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.4.0, 3.5.0, 3.6.0
    • 3.7.0
    • None

    Description

      On gitter:

      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. 
      

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              btellier Benoit Tellier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m