[
https://issues.apache.org/jira/browse/NIFI-1899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15381037#comment-15381037
]
ASF GitHub Bot commented on NIFI-1899:
--------------------------------------
Github user trixpan commented on the issue:
https://github.com/apache/nifi/pull/483
@JPercivall Beautiful code! Loved it. Interesting to see your programming
thinking. Great lesson (specially because I tried to achieve a similar - though
more covoluted - logic previously and failed. heheheh)
It makes total sense how you replaced the latch with a timed wait +
notifyAll.
The only question that I have is how do you deal with a spurious wakeup in
this section:
```
final long serverTimeout =
context.getProperty(SMTP_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS);
try {
message.wait(serverTimeout);
} catch (InterruptedException e) {
getLogger().info("Interrupted while waiting for Message
Handler to acknowledge message.");
}
```
and this section:
```
try {
message.wait(serverTimeout - elapsed);
} catch (InterruptedException e) {
// Interrupted while waiting for the message to
process. Will return error and request onTrigger to rollback
logger.trace("Interrupted while waiting for processor
to process data. Returned error to SMTP client as precautionary measure");
```
Am I correct to assume you just preferred to ignore them and take a
decision based on whatever information message object would have gathered by
that time? Something like:
if all completed by then, great, message gets acked, commited, client gets
happy, but if message is partially processed (e.g. no returnCode when it hits
the first wait above) test with resultCodeSetAndIsError and effectively treat
it as success(commit) unless an error code is set?
> Create ListenSMTP & ExtractEmailAttachment processors
> -----------------------------------------------------
>
> Key: NIFI-1899
> URL: https://issues.apache.org/jira/browse/NIFI-1899
> Project: Apache NiFi
> Issue Type: New Feature
> Reporter: Andre
> Fix For: 1.0.0
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)