Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions internal/devserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import (
"go.temporal.io/server/common/metrics"
sqliteplugin "go.temporal.io/server/common/persistence/sql/sqlplugin/sqlite"
"go.temporal.io/server/common/primitives"
"go.temporal.io/server/components/callbacks"
"go.temporal.io/server/components/nexusoperations"
"go.temporal.io/server/schema/sqlite"
sqliteschema "go.temporal.io/server/schema/sqlite"
Expand Down Expand Up @@ -241,18 +240,9 @@ func (s *StartOptions) buildServerOptions() ([]temporal.ServerOption, *slog.Leve
dynConf[dynamicconfig.HistoryCacheHostLevelMaxSize.Key()] = 8096
// Up default visibility RPS
dynConf[dynamicconfig.FrontendMaxNamespaceVisibilityRPSPerInstance.Key()] = 100
// NOTE that the URL scheme is fixed to HTTP since the dev server doesn't support TLS at the time of writing.
dynConf[nexusoperations.CallbackURLTemplate.Key()] = fmt.Sprintf(
"http://%s:%d/namespaces/{{.NamespaceName}}/nexus/callback", MaybeEscapeIPv6(s.FrontendIP), s.FrontendHTTPPort)
dynConf[callbacks.AllowedAddresses.Key()] = []struct {
Pattern string
AllowInsecure bool
}{
{
Pattern: fmt.Sprintf("%s:%d", MaybeEscapeIPv6(s.FrontendIP), s.FrontendHTTPPort),
AllowInsecure: true,
},
}
// Enable the system callback URL for worker targets.
// TODO: Remove this when upgrading to server 1.31.
dynConf[nexusoperations.UseSystemCallbackURL.Key()] = true
Copy link
Contributor

@cretz cretz Jan 30, 2026

Choose a reason for hiding this comment

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

I am curious about these Nexus dyn configs in general. Why can't a user be asked to configure these dynamic configs the same way they would if configuring any other self-hosted server? Why does other self-hosted environment not have these defaults and why must this self-hosted environment uniquely have these defaults here?

The caching and RPC limit updates make sense for local dev server, but feature defaults to not IMO. Our self-hosted dyn config requirements should be the same regardless of whether it's dev server self-hosted, docker self-hosted, binary self-hosted, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OSS server v1.31 will have this toggle enabled by default and we can remove the URL templates here.

After v1.31 no dc overrides are required for nexus.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just removed 2 other DCs.

Copy link
Member

Choose a reason for hiding this comment

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

We didn't want users to have to struggle to enable Nexus. That's why these configs were here in the first place. Starting server 1.31, Nexus will work OOTB with no dynamic config overrides.

Copy link
Member

Choose a reason for hiding this comment

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

Also note that since the HTTP port is randomly allocated by default (still considered experimental), it was deemed to difficult to configure this for a user.

Copy link
Contributor Author

@chaptersix chaptersix Feb 1, 2026

Choose a reason for hiding this comment

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

FWIW, the behavior of nexus callbacks is the same before and after this PR. Before, callbacks could only point to the dev server and after they could only point to the dev server.

After 1.31 this config will be inline with the default config of the normal server release. There's a TODO to remove these configs entirely.

Copy link
Contributor

@cretz cretz Feb 2, 2026

Choose a reason for hiding this comment

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

After 1.31 this config will be inline with the default config of the normal server release

We should wait then IMO. This CLI is for 1.30 not 1.31, and I would expect the same dyn configs to be required for users of a feeature across all releases of 1.30 (CLI, temporal release binary, docker image, helm chart, etc)

Copy link
Member

@bergundy bergundy Feb 2, 2026

Choose a reason for hiding this comment

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

Just want to clarify that this isn't for enabling Nexus, it's enabled by default. This is for making Nexus easier to use in the dev server. There is no need to walk back the decision we made a while ago to make Nexus work without extra user configuration.

This config is more for QOL, similar to HistoryCacheHostLevelMaxSize or FrontendMaxNamespaceVisibilityRPSPerInstance.

Copy link
Contributor

@cretz cretz Feb 2, 2026

Choose a reason for hiding this comment

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

This is for making Nexus easier to use in the dev server. There is no need to walk back the decision we made a while ago to make Nexus work without extra user configuration.

Nexus should be made easier to use in all 1.30 servers. If we decided not to do that for 1.30 servers, makes sense to do it for 1.31 servers. Not sure how that is related to CLI, I assume your decision to make Nexus work without user configuration is not CLI specific.

This config is more for QOL, similar to HistoryCacheHostLevelMaxSize or FrontendMaxNamespaceVisibilityRPSPerInstance.

Would users need to set this dyn config for all the other non-CLI 1.30 servers they set up to have teh same user/operator experience? Or is it an internal-only/non-user-facing optimization?

Copy link
Contributor Author

@chaptersix chaptersix Feb 2, 2026

Choose a reason for hiding this comment

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

Would users need to set this dyn config for all the other non-CLI 1.30 servers they set up to have teh same user/operator experience?

Yes, they would have to set the templating for pre-1.30 versions


// Dynamic config if set
for k, v := range s.DynamicConfigValues {
Expand Down
19 changes: 10 additions & 9 deletions internal/temporalcli/commands.workflow_view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ func (s *SharedServerSuite) TestWorkflow_Describe_NexusOperationAndCallback() {
out = res.Stdout.String()
s.ContainsOnSameLine(out, "WorkflowId", handlerWorkflowID)
s.Contains(out, "Callbacks: 1")
s.ContainsOnSameLine(out, "URL", "http://"+s.DevServer.Options.FrontendIP)
s.ContainsOnSameLine(out, "URL", "temporal://system")
s.ContainsOnSameLine(out, "Trigger", "WorkflowClosed")
s.ContainsOnSameLine(out, "State", "Succeeded")

Expand All @@ -777,11 +777,11 @@ func (s *SharedServerSuite) TestWorkflow_Describe_NexusOperationAndCallback() {
func (s *SharedServerSuite) TestWorkflow_Describe_NexusOperationBlocked() {
endpointName := validEndpointName(s.T())

// Call an unreachable operation from this workflow.
// Call an operation that has no handler registered.
callerWorkflow := func(ctx workflow.Context) error {
client := workflow.NewNexusClient(endpointName, "test-service")
fut := client.ExecuteOperation(ctx, "test-op", nil, workflow.NexusOperationOptions{})
// Destination is unreachable, the future will never complete.
// No handler is registered, the operation will fail and trigger the circuit breaker.
return fut.GetNexusOperationExecution().Get(ctx, nil)
}

Expand All @@ -790,16 +790,19 @@ func (s *SharedServerSuite) TestWorkflow_Describe_NexusOperationBlocked() {
})
defer w.Stop()

// Create an endpoint for this test.
// Create an endpoint for this test pointing to a worker target.
// The worker has no handler for "test-service"/"test-op", so requests will fail
// and eventually trigger the circuit breaker.
_, err := s.Client.OperatorService().CreateNexusEndpoint(
s.Context,
&operatorservice.CreateNexusEndpointRequest{
Spec: &nexuspb.EndpointSpec{
Name: endpointName,
Target: &nexuspb.EndpointTarget{
Variant: &nexuspb.EndpointTarget_External_{
External: &nexuspb.EndpointTarget_External{
Url: "http://localhost:12345", // unreachable destination
Variant: &nexuspb.EndpointTarget_Worker_{
Worker: &nexuspb.EndpointTarget_Worker{
Namespace: s.Namespace(),
TaskQueue: w.Options.TaskQueue,
},
},
},
Expand All @@ -808,7 +811,6 @@ func (s *SharedServerSuite) TestWorkflow_Describe_NexusOperationBlocked() {
)
s.NoError(err)

// Start the workflow and wait until the operation is started.
run, err := s.Client.ExecuteWorkflow(
s.Context,
client.StartWorkflowOptions{TaskQueue: w.Options.TaskQueue},
Expand Down Expand Up @@ -847,7 +849,6 @@ func (s *SharedServerSuite) TestWorkflow_Describe_NexusOperationBlocked() {
s.ContainsOnSameLine(out, "Operation", "test-op")
s.ContainsOnSameLine(out, "BlockedReason", "The circuit breaker is open.")

// Operations - JSON
res = s.Execute(
"workflow", "describe",
"--address", s.Address(),
Expand Down