exceptionfactory commented on code in PR #7085:
URL: https://github.com/apache/nifi/pull/7085#discussion_r1149531073
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java:
##########
@@ -638,21 +668,37 @@ private boolean isMutableRequest(final String method) {
}
}
- private boolean isDeleteConnection(final String method, final String
uriPath) {
+ private boolean isDeleteComponent(final String method, final String
uriPath) {
if (!HttpMethod.DELETE.equalsIgnoreCase(method)) {
return false;
}
- final boolean isConnectionUri =
ConnectionEndpointMerger.CONNECTION_URI_PATTERN.matcher(uriPath).matches();
- return isConnectionUri;
+ // Check if the URI indicates that a component should be deleted.
+ // We cannot simply make our decision based on the fact that the
request is a DELETE request.
+ // This is because we do need to allow deletion of asynchronous
requests, such as updating parameters, querying provenance, etc.
+ // which create a request, poll until the request completes, and then
deletes it. Additionally, we want to allow terminating
+ // Processors, which is done by issuing a request to DELETE
/processors/<id>/threads
Review Comment:
On further consideration, this approach seems the most maintainable, since
it is rare to add new types of components to the framework.
After reviewing, it looks like Labels, Parameter Providers, and Flow
Registry Clients should also be added to the list of components to check.
--
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]