Skip to content

Conversation

shijiesheng
Copy link
Member

@shijiesheng shijiesheng commented Sep 15, 2025

What changed?

Migration Guide

  • To construct GRPC Workflow Service use new WorkflowServiceGrpc() instead of new Thrift2ProtoAdapter(IGrpcServiceStubs.newInstance());
  • Removed TException and now all workflow service method returns CadenceError instead;
  • Replaced thrift generated entities with internal entities (Currently still generated from thrift files but no longer has runtime dependency on thrift);
  • Removed support for thrift entities in default data converter;

Why?

Java thrift deprecation

How did you test it?

Unit Test

Potential risks

Release notes

Documentation Changes

@shijiesheng shijiesheng changed the title Thrift Deprecation Part 1: replace thrift entities with internal ones feat (thrift deprecation)!: replace thrift entities with internal ones Sep 29, 2025

if (response.getExecutionsSize() < listRequest.getMaximumPageSize()) {
int neededPageSize = listRequest.getMaximumPageSize() - response.getExecutionsSize();
if (response.getExecutions().size() < listRequest.getMaximumPageSize()) {
Copy link
Member

Choose a reason for hiding this comment

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

if getExecutions() returns null this would cause a NPE. Not sure if that's actually possible based on the mapper and how protos behave.

Copy link
Member Author

Choose a reason for hiding this comment

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

addressed similar cases with default initialization in the generated entity. For example,

@data
class SomeEntity {
  List<String> SomeList = new ArrayList<>();
}

import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;

public interface IWorkflowService extends Iface, AsyncIface {
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove IFace and AsyncIface. I think IWorkflowService works well enough as the main interface and none of our code refers to either of these explicitly. It's unlikely that user code does as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

CadenceError;
}

interface AsyncIface {
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove any of the methods in AsyncIface that were never implemented? I recall there being a bunch that will just throw an exception. Users are unlikely to be calling them since they never worked in the first place.

Copy link
Member

Choose a reason for hiding this comment

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

Huh it turns out they're pretty much all implemented in gRPC. I guess our gRPC support was more thorough than Thrift.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'll just leave it unchanged.

return nullFields;
}

public static <E extends Enum<E> & TFieldIdEnum, M extends TBase<M, E>> void assertMissingFields(
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to remove the thrift functions from here.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed all thrift related stuff

RequestMapper::registerDomainRequest,
"emitMetric"), // Thrift has this field but proto doens't have it
RequestMapper
::registerDomainRequest), // Thrift has this field but proto doens't have it
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Either the comment was incorrect or something weird is going on. Something should be changed here (maybe we just need to remove the comment).

Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed the comment

compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
compile group: 'com.auth0', name: 'java-jwt', version:'3.10.2'
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.21.9'
compile group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '2.10.0'
Copy link
Member

Choose a reason for hiding this comment

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

I can't comment on the specific line (github won't let me), but we should remove the tchannel and libthrift dependencies that are above here.

Copy link
Member

Choose a reason for hiding this comment

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

Also fine if that's a followup PR to remove the lingering references. It seems like thrift library types are still used here and there.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've cleaned up all thrift related logic.

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.

2 participants