markap14 commented on PR #6420: URL: https://github.com/apache/nifi/pull/6420#issuecomment-1251568321
@emiliosetiadarma I think we need to be careful here. This is updating the API, but I'm not sure this is the right abstraction. The `resolveIrrelevantProperties` is a bit of a leaky abstraction. It's not clear when and where this should be called. The lifecycle doesn't really fit. Additionally, I don't think the `containsCyclicDependencies` is really necessary here, at least in this context. The framework already has the logic to avoid performing validation against properties that are not used (see https://github.com/apache/nifi/blob/main/nifi-api/src/main/java/org/apache/nifi/components/AbstractConfigurableComponent.java#L99-L102). The problem here is a bug in the ListenSyslog Processor. It is specifically checking this: ``` final String protocol = validationContext.getProperty(PROTOCOL).getValue(); final SSLContextService sslContextService = validationContext.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class); if (UDP_VALUE.getValue().equals(protocol) && sslContextService != null) { results.add(new ValidationResult.Builder() .explanation("SSL can not be used with UDP") .valid(false).subject("SSL Context").build()); } ``` This made sense when it was written, as there was no ability to make one property depend on another. However, later the SSLContext Service property became dependent on the protocol property. When this happened, this whole block of code should have been removed. I do think it's reasonable to update the code such that calling `getProperty(...)` will return a `PropertyValue` with a `null` value if the dependency is not satisfied. However, I think we can do this more simply by making use of the `isDependencySatisfied` method as illustrated above in AbstractConfigurableComponent. I also think it should be addressed as a separate Jira, as this Jira is really pointing out a bug that is specific to ListenSyslog. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
