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

PollWorkflowTaskQueueResponse should be available for interception #1051

Open
Spikhalskiy opened this issue Feb 22, 2022 · 1 comment
Open
Labels
enhancement User experience

Comments

@Spikhalskiy
Copy link
Contributor

Is your feature request related to a problem? Please describe.
PollWorkflowTaskQueueResponse has the information about the WorkflowTask and contains some pieces of information that may be needed for reporting/logging.
Specifically, the most interesting one is PollWorkflowTaskQueueResponse#attempt that may be used to log workflows that can't progress for a long time.

Describe the solution you'd like
PollWorkflowTaskQueueResponse or some parts of it should be made available to the user-configured handler/interceptor.

TBD. It also can become an input of a new method of WorkflowInboundInterceptor. TBD because currently all methods of Interceptors are extremely bound to the user code lifecycle and directly connected to events in the user code, while this method would be something that interceptors are not currently observed/expose.

Describe alternatives you've considered
To solve the specific problem of reporting a workflow that doesn't progress because of a large number of failures, we can just hardcode logging in a manner that Server currently does: https://github.com/temporalio/temporal/blob/61b9b65744e455d4a85681b117e8315287911621/service/history/workflow/workflow_task_state_machine.go#L763
This solution is not flexible and doesn't move the extensibility of the SDK forward though.

Additional context
Related to temporalio/temporal#2526

@Spikhalskiy Spikhalskiy added the enhancement User experience label Feb 22, 2022
@cretz
Copy link
Member

cretz commented Feb 22, 2022

Technically this can be done with a gRPC interceptor. My concern with putting in our interceptors is we won't get to change our polling mechanism without breaking it. If it's needed for reporting/logging, maybe just making the most recent task available for a getter is good enough?

If done via our interceptors, arguably pollWorkflowTaskQueue should be on the outbound interceptor (and an equivalent for activities). I had considered putting it on the client interceptors, but in some languages like TypeScript that is a bit more difficult since it's Core that makes the call.

Also, we might want a general cross-SDK issue at https://github.com/temporalio/sdk-features or at least a general cross-SDK discussion because TypeScript won't be able to do this as cleanly as Go/Java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement User experience
Projects
None yet
Development

No branches or pull requests

2 participants