Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reply with exception instead of empty list when creating/deleting ACLs #140

Open
jeqo opened this issue Jul 14, 2023 · 2 comments
Open

Reply with exception instead of empty list when creating/deleting ACLs #140

jeqo opened this issue Jul 14, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jeqo
Copy link
Contributor

jeqo commented Jul 14, 2023

At the moment, the Authorizer is only designed for read-only capabilities. Though, create/delete ACLs is replying with an empty list and logging the error.

As a client calling these operations there's the misleading impression that ACLs may be created/deleted. Furthermore, this case an exception on the broker-side as broker also fails to map a successful response.

[2023-05-17 10:10:54,306] ERROR [KafkaApi-65] Unexpected error handling request RequestHeader(apiKey=CREATE_ACLS, apiVersion=3, clientId=adminclient-22, correlationId=11651) -- CreateAclsRequestData(cr>
java.lang.IndexOutOfBoundsException: 0 is out of bounds (min 0, max -1)
        at scala.collection.mutable.ArrayBuffer.apply(ArrayBuffer.scala:99)
        at kafka.server.AclApis.$anonfun$handleCreateAcls$8(AclApis.scala:115)
        at scala.collection.mutable.HashMap.getOrElse(HashMap.scala:436)
        at kafka.server.AclApis.$anonfun$handleCreateAcls$7(AclApis.scala:115)
        at scala.collection.StrictOptimizedIterableOps.map(StrictOptimizedIterableOps.scala:100)
        at scala.collection.StrictOptimizedIterableOps.map$(StrictOptimizedIterableOps.scala:87)
        at scala.collection.mutable.ArrayBuffer.map(ArrayBuffer.scala:43)
        at kafka.server.AclApis.sendResponseCallback$1(AclApis.scala:114)
        at kafka.server.AclApis.$anonfun$handleCreateAcls$10(AclApis.scala:127)
        at kafka.server.DelayedFuture.onComplete(DelayedFuture.scala:62)
        at kafka.server.DelayedOperation.forceComplete(DelayedOperation.scala:72)
        at kafka.server.DelayedFuture.tryComplete(DelayedFuture.scala:47)
        at kafka.server.DelayedOperation.safeTryCompleteOrElse(DelayedOperation.scala:110)
        at kafka.server.DelayedOperationPurgatory.tryCompleteElseWatch(DelayedOperation.scala:234)
        at kafka.server.DelayedFuturePurgatory.tryCompleteElseWatch(DelayedFuture.scala:85)
        at kafka.server.AclApis.handleCreateAcls(AclApis.scala:127)

Returning an exception should give a better experience until this functionality is supported.

@jeqo jeqo added the bug Something isn't working label Jul 14, 2023
@ivanyu
Copy link
Contributor

ivanyu commented Jul 14, 2023

This was done purposefully. I wouldn't advocate for or against this approach now, but we need to see how different clients may behave if we do this change.

@jeqo
Copy link
Contributor Author

jeqo commented Jul 14, 2023

Agree, may require a major version bump as changes expected behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants