How to handle Poller exceptions

I have this up and running:

WorkerFactory factory = WorkerFactory.newInstance(client);
WorkerOptions o = WorkerOptions.newBuilder()
 Worker worker = factory.newWorker(temporalConfiguration.getTaskQueue(), o);

Now I want to handle exceptions thrown by the ThreadPoolExecutor backed by Poller class.

PollerOptions pollerOptions = PollerOptions.newBuilder()

My question is, how can I set that PollerOptions while creating the Worker?
On WorkerOptions builder I can’t see any setter for PollerOptions.
I have tried on Temporal versions 1.17.0 and 1.19.0.


Hi, can you help me please?

I don’t think it is exposed. What is the problem you are trying to solve?

When starting my WORKER, depending on the error condition, I can receive an stacktrace like this:

2023-05-22 20:33:22,151 WARN  [worker] [Workflow Poller taskQueue="tq1234", namespace="default": 2] [] io.temporal.internal.worker.Poller: Failure in poller thread Workflow Poller taskQueue="tq1234", namespace="default": 2
io.grpc.StatusRuntimeException: UNIMPLEMENTED: unknown service temporal.api.workflowservice.v1.WorkflowService
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(
	at io.grpc.stub.ClientCalls.getUnchecked(
	at io.grpc.stub.ClientCalls.blockingUnaryCall(
	at io.temporal.api.workflowservice.v1.WorkflowServiceGrpc$WorkflowServiceBlockingStub.pollWorkflowTaskQueue(
	at io.temporal.internal.worker.WorkflowPollTask.doPoll(
	at io.temporal.internal.worker.WorkflowPollTask.poll(
	at io.temporal.internal.worker.WorkflowPollTask.poll(
	at io.temporal.internal.worker.Poller$
	at io.temporal.internal.worker.Poller$
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/

It would be useful for me to handle those Poller exceptions and for example report them to my monitoring platform. That’s why I want to set the exception handler.

Would you file a feature request against the SDK?

1 Like