Skip to content

Audit and fix thrift RPC problems#6423

Open
ctubbsii wants to merge 2 commits into
apache:2.1from
ctubbsii:fix-thrift-6061
Open

Audit and fix thrift RPC problems#6423
ctubbsii wants to merge 2 commits into
apache:2.1from
ctubbsii:fix-thrift-6061

Conversation

@ctubbsii

Copy link
Copy Markdown
Member
  • Use Client instead of Iface where it makes sense
  • Remove improperly thrown exceptions from RPC implementation methods (TException when specified directly, and any others that are not declared in the IDL for that method)
  • Add some essential exceptions to Thrift IDL where they were previously missed (and assumed to work)
  • Create an integration test that inspects our thrift service implementations and verifies we haven't introduced additional mistakes
  • Update JUnit and EasyMock to work better with Eclipse IDE on newer Java versions
  • Add some missing descriptions to some ThriftTableOperationException instances
  • Remove improper constructions of TApplicationException (should only be constructed internally inside libthrift, never by us, as it is an exception that signals to a client that a server-side exception occurred, most often by a runtime exception being thrown on the server side)
  • Construct ThriftSecurityOperation directly in RPC handler code, instead of constructing as AccumuloSecurityException and then calling .asThriftException(); that method is provided to make it easy to serialize public API exceptions for RPC requests, and is not needed in RPC code itself
  • Remove some attempts to convert RuntimeExceptions to TException in RPC handling code

This fixes #6061

* Use Client instead of Iface where it makes sense
* Remove improperly thrown exceptions from RPC implementation methods
  (TException when specified directly, and any others that are not
  declared in the IDL for that method)
* Add some essential exceptions to Thrift IDL where they were previously
  missed (and assumed to work)
* Create an integration test that inspects our thrift service
  implementations and verifies we haven't introduced additional mistakes
* Update JUnit and EasyMock to work better with Eclipse IDE on newer
  Java versions
* Add some missing descriptions to some ThriftTableOperationException
  instances
* Remove improper constructions of TApplicationException (should only be
  constructed internally inside libthrift, never by us, as it is an
  exception that signals to a client that a server-side exception
  occurred, most often by a runtime exception being thrown on the server
  side)
* Construct ThriftSecurityOperation directly in RPC handler code,
  instead of constructing as AccumuloSecurityException and then calling
  .asThriftException(); that method is provided to make it easy to
  serialize public API exceptions for RPC requests, and is not needed in
  RPC code itself
* Remove some attempts to convert RuntimeExceptions to TException in RPC
  handling code

This fixes apache#6061
@ctubbsii ctubbsii added this to the 2.1.5 milestone Jun 11, 2026
@ctubbsii ctubbsii self-assigned this Jun 11, 2026
@ctubbsii ctubbsii changed the base branch from main to 2.1 June 11, 2026 03:21
@ctubbsii

Copy link
Copy Markdown
Member Author

@ddanielr This addresses some gaps left by #3177 with the addition of the ThriftPropertyException in the method signatures of the handler code, but I'm not sure if it fully addresses all the intentions you had with that PR.

@ctubbsii ctubbsii requested review from ddanielr and dlmarion June 11, 2026 03:24

@ddanielr ddanielr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddanielr This addresses some gaps left by #3177 with the addition of the ThriftPropertyException in the method signatures of the handler code, but I'm not sure if it fully addresses all the intentions you had with that PR.

Changes look fine. The behavior added in #3177 still works.

The client still receives an error about why the modify properties operation failed on instance operations.

org.apache.accumulo.core.client.AccumuloException: ThriftPropertyException(property:Modify properties, value:failed, description:Property tserver.scan.files.open.max with value: foo is not valid)

And table operations error the same way and still return the table ID.

org.apache.accumulo.core.client.AccumuloException: ThriftPropertyException(property:Modify properties, value:failed, description:Invalid property for : TablePropKey{TableId=1} name: table.bulk.max.tablets, value: thousand)

@ctubbsii

Copy link
Copy Markdown
Member Author

This is going to take a bit of time to merge to main. I'll hold off merging to 2.1 for a couple hours while I ensure that I can merge it cleanly into main soon after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit Thrift RPC handlers to identify mismatched TException types

2 participants