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
4 changes: 4 additions & 0 deletions service/frontend/namespace_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,10 @@ func (d *namespaceHandler) createResponse(
ReportedProblemsSearchAttribute: numConsecutiveWorkflowTaskProblemsToTriggerSearchAttribute > 0,
WorkerHeartbeats: d.config.WorkerHeartbeatsEnabled(info.Name),
},
Limits: &namespacepb.NamespaceInfo_Limits{
BlobSizeLimitError: int64(d.config.BlobSizeLimitError(info.Name)),
MemoSizeLimitError: int64(d.config.MemoSizeLimitError(info.Name)),
},
SupportsSchedules: d.config.EnableSchedules(info.Name),
}

Expand Down
8 changes: 7 additions & 1 deletion service/frontend/namespace_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (s *namespaceHandlerCommonSuite) TestListNamespace() {
}
}

func (s *namespaceHandlerCommonSuite) TestCapabilities() {
func (s *namespaceHandlerCommonSuite) TestCapabilitiesAndLimits() {
s.mockMetadataMgr.EXPECT().GetNamespace(gomock.Any(), &persistence.GetNamespaceRequest{
Name: "ns",
}).Return(
Expand All @@ -384,13 +384,17 @@ func (s *namespaceHandlerCommonSuite) TestCapabilities() {
s.True(resp.NamespaceInfo.Capabilities.AsyncUpdate)
s.True(resp.NamespaceInfo.Capabilities.ReportedProblemsSearchAttribute)
s.True(resp.NamespaceInfo.Capabilities.WorkerHeartbeats)
s.Equal(int64(2*1024*1024), resp.NamespaceInfo.Limits.BlobSizeLimitError)
s.Equal(int64(2*1024*1024), resp.NamespaceInfo.Limits.MemoSizeLimitError)

// Second call: Override the default value of dynamic configs.
s.config.EnableEagerWorkflowStart = dc.GetBoolPropertyFnFilteredByNamespace(false)
s.config.EnableUpdateWorkflowExecution = dc.GetBoolPropertyFnFilteredByNamespace(false)
s.config.EnableUpdateWorkflowExecutionAsyncAccepted = dc.GetBoolPropertyFnFilteredByNamespace(false)
s.config.NumConsecutiveWorkflowTaskProblemsToTriggerSearchAttribute = dc.GetIntPropertyFnFilteredByNamespace(5)
s.config.WorkerHeartbeatsEnabled = dc.GetBoolPropertyFnFilteredByNamespace(false)
s.config.BlobSizeLimitError = dc.GetIntPropertyFnFilteredByNamespace(1024)
s.config.MemoSizeLimitError = dc.GetIntPropertyFnFilteredByNamespace(512)

resp, err = s.handler.DescribeNamespace(context.Background(), &workflowservice.DescribeNamespaceRequest{
Namespace: "ns",
Expand All @@ -401,6 +405,8 @@ func (s *namespaceHandlerCommonSuite) TestCapabilities() {
s.False(resp.NamespaceInfo.Capabilities.AsyncUpdate)
s.True(resp.NamespaceInfo.Capabilities.ReportedProblemsSearchAttribute)
s.False(resp.NamespaceInfo.Capabilities.WorkerHeartbeats)
s.Equal(int64(1024), resp.NamespaceInfo.Limits.BlobSizeLimitError)
s.Equal(int64(512), resp.NamespaceInfo.Limits.MemoSizeLimitError)
}

func (s *namespaceHandlerCommonSuite) TestRegisterNamespace_WithOneCluster() {
Expand Down
2 changes: 2 additions & 0 deletions service/frontend/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ type Config struct {
// size limit system protection
BlobSizeLimitError dynamicconfig.IntPropertyFnWithNamespaceFilter
BlobSizeLimitWarn dynamicconfig.IntPropertyFnWithNamespaceFilter
MemoSizeLimitError dynamicconfig.IntPropertyFnWithNamespaceFilter

ThrottledLogRPS dynamicconfig.IntPropertyFn

Expand Down Expand Up @@ -297,6 +298,7 @@ func NewConfig(
DisableListVisibilityByFilter: dynamicconfig.DisableListVisibilityByFilter.Get(dc),
BlobSizeLimitError: dynamicconfig.BlobSizeLimitError.Get(dc),
BlobSizeLimitWarn: dynamicconfig.BlobSizeLimitWarn.Get(dc),
MemoSizeLimitError: dynamicconfig.MemoSizeLimitError.Get(dc),
ThrottledLogRPS: dynamicconfig.FrontendThrottledLogRPS.Get(dc),
ShutdownDrainDuration: dynamicconfig.FrontendShutdownDrainDuration.Get(dc),
ShutdownFailHealthCheckDuration: dynamicconfig.FrontendShutdownFailHealthCheckDuration.Get(dc),
Expand Down
Loading