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
6 changes: 3 additions & 3 deletions service/matching/workers/registry_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,11 @@ func (m *registryImpl) DescribeWorker(nsID namespace.ID, workerInstanceKey strin

// isSystemWorker determines if a worker is a system worker.
// If a principal is available, it checks whether the principal identifies
// the Temporal server itself (type="temporal", name="internal"). Otherwise,
// it falls back to checking the task queue name prefix.
// the Temporal server itself (type="temporal"). Otherwise, it falls back to
// checking the task queue name prefix.
func isSystemWorker(principal *commonpb.Principal, taskQueue string) bool {
if principal != nil {
return principal.GetType() == authorization.InternalPrincipalType && principal.GetName() == authorization.InternalPrincipalName
return principal.GetType() == authorization.InternalPrincipalType
}
return primitives.IsInternalTaskQueue(taskQueue)
}
4 changes: 2 additions & 2 deletions service/matching/workers/registry_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func TestIsSystemWorker(t *testing.T) {
require.Len(t, list, 1)
})

t.Run("principal with type temporal but non-internal name is not system worker", func(t *testing.T) {
t.Run("principal with type temporal but non-internal name is still system worker", func(t *testing.T) {
m := newRegistryImpl(testDefaultRegistryParams(metrics.NoopMetricsHandler))
defer m.Stop()

Expand All @@ -240,7 +240,7 @@ func TestIsSystemWorker(t *testing.T) {
})

list := m.filterWorkers("ns", false /* includeSystemWorkers */, alwaysTrue)
require.Len(t, list, 1, "worker with non-internal name should not be excluded")
require.Empty(t, list, "worker with temporal principal type should be excluded regardless of name")
})

t.Run("principal with non-temporal type is not system worker", func(t *testing.T) {
Expand Down
Loading