1343
return true, nil
1344
}
1346
}
1347
1348
// Returns true if the workflow is running and mutable state size should trigger a forced termination
1349
// Prints a log message if mutable state size is over the error or warn limits
1350
>
func (c *ContextImpl) maxMutableStateSizeExceeded(chasmRegistry *chasm.Registry) bool {
context.go
1351
>
mutableStateSizeLimitError := c.config.MutableStateSizeLimitError()
1352
>
mutableStateSizeLimitWarn := c.config.MutableStateSizeLimitWarn()
1353
>
1354
>
mutableStateSize := c.MutableState.GetApproximatePersistedSize()
1355
>
metricsHandler := c.metricsHandler
1356
>
if archetypeTag, ok := getArchetypeMetricTag(chasmRegistry, c.MutableState.ChasmTree().ArchetypeID()); ok {
1357
>
metricsHandler = metricsHandler.WithTags(archetypeTag)
1358
>
}
1359
>
metrics.PersistedMutableStateSize.With(metricsHandler).Record(int64(mutableStateSize))
1360
>
1361
>
if mutableStateSize > mutableStateSizeLimitError {
1362
c.logger.Warn("mutable state size exceeds error limit.",
1363
tag.WorkflowMutableStateSize(mutableStateSize))