You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by jtstorck <gi...@git.apache.org> on 2016/08/24 19:07:30 UTC
[GitHub] nifi pull request #931: NIFI-2642 Catches (and ignores) ResourceNotFoundExce...
GitHub user jtstorck opened a pull request:
https://github.com/apache/nifi/pull/931
NIFI-2642 Catches (and ignores) ResourceNotFoundException during the \u2026
\u2026updating of a property value for a controller service when the current value points to a controller service that has been deleted, allowing the assigning of a new controller service to continue.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jtstorck/nifi NIFI-2642
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/931.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #931
----
commit 6f3661c8d7bb953a012652d15e5ad3a910a2ccf9
Author: Jeff Storck <jt...@gmail.com>
Date: 2016-08-24T19:06:01Z
NIFI-2642 Catches (and ignores) ResourceNotFoundException during the updating of a property value for a controller service when the current value points to a controller service that has been deleted, allowing the assigning of a new controller service to continue.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi pull request #931: NIFI-2642 Catches (and ignores) ResourceNotFoundExce...
Posted by olegz <gi...@git.apache.org>.
Github user olegz commented on a diff in the pull request:
https://github.com/apache/nifi/pull/931#discussion_r76122947
--- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/authorization/AuthorizeControllerServiceReference.java ---
@@ -57,8 +58,12 @@ public static void authorizeControllerServiceReferences(final Map<String, String
if (!Objects.equals(currentValue, proposedValue)) {
// ensure access to the old service
if (currentValue != null) {
- final Authorizable currentServiceAuthorizable = lookup.getControllerService(currentValue).getAuthorizable();
- currentServiceAuthorizable.authorize(authorizer, RequestAction.READ, user);
+ try {
+ final Authorizable currentServiceAuthorizable = lookup.getControllerService(currentValue).getAuthorizable();
+ currentServiceAuthorizable.authorize(authorizer, RequestAction.READ, user);
+ } catch (ResourceNotFoundException e) {
+ // ignore if the resource is not found, if currentValue was previously deleted, it should not stop assignment of proposedValue
--- End diff --
fair enough
+1, merging
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi pull request #931: NIFI-2642 Catches (and ignores) ResourceNotFoundExce...
Posted by olegz <gi...@git.apache.org>.
Github user olegz commented on a diff in the pull request:
https://github.com/apache/nifi/pull/931#discussion_r76121783
--- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/authorization/AuthorizeControllerServiceReference.java ---
@@ -57,8 +58,12 @@ public static void authorizeControllerServiceReferences(final Map<String, String
if (!Objects.equals(currentValue, proposedValue)) {
// ensure access to the old service
if (currentValue != null) {
- final Authorizable currentServiceAuthorizable = lookup.getControllerService(currentValue).getAuthorizable();
- currentServiceAuthorizable.authorize(authorizer, RequestAction.READ, user);
+ try {
+ final Authorizable currentServiceAuthorizable = lookup.getControllerService(currentValue).getAuthorizable();
+ currentServiceAuthorizable.authorize(authorizer, RequestAction.READ, user);
+ } catch (ResourceNotFoundException e) {
+ // ignore if the resource is not found, if currentValue was previously deleted, it should not stop assignment of proposedValue
--- End diff --
I wonder if instead of raising and then catching exception and do nothing we should instead introduce ```canLocate(id)``` or ```isLocatable```?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi pull request #931: NIFI-2642 Catches (and ignores) ResourceNotFoundExce...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/nifi/pull/931
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi pull request #931: NIFI-2642 Catches (and ignores) ResourceNotFoundExce...
Posted by jtstorck <gi...@git.apache.org>.
Github user jtstorck commented on a diff in the pull request:
https://github.com/apache/nifi/pull/931#discussion_r76122724
--- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/authorization/AuthorizeControllerServiceReference.java ---
@@ -57,8 +58,12 @@ public static void authorizeControllerServiceReferences(final Map<String, String
if (!Objects.equals(currentValue, proposedValue)) {
// ensure access to the old service
if (currentValue != null) {
- final Authorizable currentServiceAuthorizable = lookup.getControllerService(currentValue).getAuthorizable();
- currentServiceAuthorizable.authorize(authorizer, RequestAction.READ, user);
+ try {
+ final Authorizable currentServiceAuthorizable = lookup.getControllerService(currentValue).getAuthorizable();
+ currentServiceAuthorizable.authorize(authorizer, RequestAction.READ, user);
+ } catch (ResourceNotFoundException e) {
+ // ignore if the resource is not found, if currentValue was previously deleted, it should not stop assignment of proposedValue
--- End diff --
That section of code can still raise an AccessDeniedException, we're just ignoring the RNFE in this specific case. There are probably other cases where the RNFE would bubble up to the UI, where the exception mapper would handle it properly, but in this case it was preventing the new controller service to be assigned. I think for 1.0.0, this is the best fix.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi issue #931: NIFI-2642 Catches (and ignores) ResourceNotFoundException d...
Posted by olegz <gi...@git.apache.org>.
Github user olegz commented on the issue:
https://github.com/apache/nifi/pull/931
Reviewing
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---