Hi Temporal team!
I’m looking for ways to simplify Temporal development experience for new engineers from my organization. As part of that, I’ve created a small generic code that could automatically create a namespace on worker/starter application startup. The idea is to have it off for staging and production (so namespaces have to be manually created there) but be able to automatically create required namespaces on a local machine.
To do that, I make a
DescribeNamespace call and it fails, make a
RegisterNamespace call. This works fine in the sense that namespace is created and is visible in Temporal web, however, it’s not immediately “useful” as for ~10-15 seconds after namespace was created requests fail with
io.grpc.StatusRuntimeException: NOT_FOUND: namespace: basic_worker-namespace not found at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262) at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243) at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156) at io.temporal.api.workflowservice.v1.WorkflowServiceGrpc$WorkflowServiceBlockingStub.startWorkflowExecution(WorkflowServiceGrpc.java:2614) at io.temporal.internal.external.GenericWorkflowClientExternalImpl.lambda$start$0(GenericWorkflowClientExternalImpl.java:88) at io.temporal.internal.common.GrpcRetryer.retryWithResult(GrpcRetryer.java:97) at io.temporal.internal.external.GenericWorkflowClientExternalImpl.start(GenericWorkflowClientExternalImpl.java:81)
I tried to run another
DescribeNamespace call after
RegisterNamespace but it succeeds and indicated the namespace is already created. Same with
The best workaround I’ve found for now is to make a
GetWorkflowExecutionHistory request for some fake workflow id. If it fails with status code
NOT_FOUND I deduce the namespace is not propagated yet, once it fails with
INVALID_ARGUMENT I assume the namespace is ready and I can let worker and client request go.
Is there a way to tell that the namespace is “ready” and other calls can be initiated? I feel I’m missing something pretty obvious.