HOTFIX: Use a true sentinel for UseDefaultAcls#2829
HOTFIX: Use a true sentinel for UseDefaultAcls#2829ijuma wants to merge 3 commits intoapache:trunkfrom
UseDefaultAcls#2829Conversation
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
@ijuma Thanks for the PR. LGTM. |
|
Just to clarify - we need to merge this into both trunk and 0.10.2 and roll out a new RC? |
|
I looked into this some more and I think we don't need to do another RC. The reason is that passing an empty list of ACLs throws an error in ZkClient.create(): if (acl == null || acl.size() == 0) {
throw new NullPointerException("Missing value for ACL");
}So 67fc2a9 only affects the behaviour of code that caused an exception previously. It seems that, in the worst case, it may cause test code that was checking this exceptional condition to break. Given that, it doesn't seem worth another RC by itself. The next question is whether this PR should be merged at all. It seems safer to throw an exception in case an empty list is passed than to assume the caller wanted the default ACLs to be applied. So, I'd say we should probably merge to trunk and 0.10.2 so that we have consistent behaviour in both branches. If another RC for 0.10.2.1 is required, then we'll include it there, but otherwise, we won't. Thoughts? |
|
Sounds good. I'll merge to both branches |
In 67fc2a9, we are using an empty collection and comparing via value equality, so if a user passes an empty collection, they will get the default ACLs instead of no ACLs. We fix that issue here. Author: Ismael Juma <ismael@juma.me.uk> Reviewers: Rajini Sivaram Closes #2829 from ijuma/zk-utils-default-acls-improvement and squashes the following commits: 0846172 [Ismael Juma] Add missing import 2dc84f3 [Ismael Juma] Simplify logic in `sensitivePath` 8122f27 [Ismael Juma] Use a true sentinel instead of an empty collection for `UseDefaultAcls` (cherry picked from commit c31958e) Signed-off-by: Gwen Shapira <cshapi@gmail.com>
In 67fc2a9, we are using an empty collection and comparing via
value equality, so if a user passes an empty collection, they will
get the default ACLs instead of no ACLs. We fix that issue here.