[ https://issues.apache.org/jira/browse/JSPF-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17869296#comment-17869296 ]
HABA commented on JSPF-112: --------------------------- Hello [~btellier], Thank you for the quick response and for proposing the fix. After applying the changes from PR [#24|https://github.com/apache/james-jspf/pull/24], the following exception now appears: {code:java} 11:56:23.770 [ForkJoinPool.commonPool-worker-1] ERROR org.apache.james.jspf.impl.SPF -- null org.xbill.DNS.lookup.NoSuchDomainException: null at org.xbill.DNS.lookup.LookupSession.buildResult(LookupSession.java:691) at org.xbill.DNS.lookup.LookupSession.lambda$lookupWithResolver$8(LookupSession.java:557) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) at java.base/java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:614) at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1163) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) 11:56:23.774 [dnsjava NIO selector] DEBUG org.xbill.DNS.NioClient -- dnsjava NIO selector thread stopped{code} With the previous version, we encountered the following exception instead: {code:java} org.apache.james.jspf.core.exceptions.NoneException: No SPF record found for host: unicredit.de at org.apache.james.jspf.policies.NoSPFRecordFoundPolicy.getSPFRecord(NoSPFRecordFoundPolicy.java:37) at org.apache.james.jspf.impl.SPF$SPFPolicyPostFilterChecker.checkSPF(SPF.java:174) at org.apache.james.jspf.executor.AsynchronousSPFExecutor.execute(AsynchronousSPFExecutor.java:59) at org.apache.james.jspf.impl.SPF.checkSPF(SPF.java:305) at org.habax.hdbaserver.engines.EngineSmtpReceiveProcessor.main(EngineSmtpReceiveProcessor.java:1278) 11:59:30.623 [ForkJoinPool.commonPool-worker-1] DEBUG org.xbill.DNS.Cache -- Caching NXRRSET for unicredit.de./SPF 11:59:30.628 [dnsjava NIO selector] DEBUG org.xbill.DNS.NioClient -- dnsjava NIO selector thread stopped{code} While the timeout issue seems to be addressed, it would be helpful to receive an exception message that clearly indicates the absence of an SPF record, similar to the {{NoneException}} we received previously. This would improve the clarity of the error handling and help in diagnosing issues. Best Regards, HABA > Bug: SPF Check Hangs Indefinitely in > org.apache.james.jspf:apache-jspf-resolver:1.0.4 > ------------------------------------------------------------------------------------- > > Key: JSPF-112 > URL: https://issues.apache.org/jira/browse/JSPF-112 > Project: James jSPF > Issue Type: Bug > Components: Core > Environment: WIN SERVER 2016, JAVA 17.0.10 > Reporter: HABA > Priority: Blocker > Time Spent: 10m > Remaining Estimate: 0h > > When performing an SPF check using > org.apache.james.jspf:apache-jspf-resolver:1.0.4, the process hangs > indefinitely during the DNS resolution phase. The issue is observed with the > following SPF check: > {code:java} > String spfResult = new > DefaultSPF().checkSPF("207.54.72.202","do_not_re...@unicredit.de","esa13.hc437-5.eu.iphmx.com").getResult();{code} > The log indicates the process gets stuck at the A-Record lookup for the > domain 207.54.72.202.spf.hc210-93.eu.iphmx.com, with repeated debug messages > until it eventually times out after multiple hours: > {code:java} > [ForkJoinPool.commonPool-worker-1] DEBUG > org.apache.james.jspf.core.MacroExpand -- Domain expanded: > 207.54.72.202.spf.hc210-93.eu.iphmx.com > [ForkJoinPool.commonPool-worker-1] DEBUG > org.apache.james.jspf.impl.DNSServiceXBillImpl -- Start A-Record lookup for : > 207.54.72.202.spf.hc210-93.eu.iphmx.com > [ForkJoinPool.commonPool-worker-1] DEBUG org.xbill.DNS.ExtendedResolver -- > Sending 207.54.72.202.spf.hc210-93.eu.iphmx.com./A, id=20803 to resolver 0 > (SimpleResolver [/X.X.X.X:53]), attempt 1 of 3 > [ForkJoinPool.commonPool-worker-1] DEBUG org.xbill.DNS.SimpleResolver -- > Sending 207.54.72.202.spf.hc210-93.eu.iphmx.com./A, id=20803 to udp/X.X.X.X:53 > [ForkJoinPool.commonPool-worker-1] DEBUG org.xbill.DNS.Cache -- Caching > NXDOMAIN for 207.54.72.202.spf.hc210-93.eu.iphmx.com./A{code} > This issue does not occur with version 1.0.3, where the SPF check completes > successfully. > *Steps to Reproduce:* > Use org.apache.james.jspf:apache-jspf-resolver:1.0.4. > Perform the SPF check with the provided code snippet. > Observe the logs and notice the process getting stuck at the DNS > resolution step. > *Expected Result:* > The SPF check should complete without hanging, as it does in version 1.0.3. > *Actual Result:* > The SPF check hangs indefinitely during DNS resolution, eventually timing out > after several hours.{*}{*} > *Version:* org.apache.james.jspf:apache-jspf-resolver:1.0.4 > *Previous Working Version:* > org.apache.james.jspf:apache-jspf-resolver:1.0.3 -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org