File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ import (
43
43
)
44
44
45
45
const (
46
- queryResultSizeLimit = 2000000 // 2MB
46
+ queryResultSizeLimit = 2000000 // 2MB
47
+ historySizeEstimationBuffer = 1 * 128 // 128B
47
48
)
48
49
49
50
// Make sure that interfaces are implemented
@@ -940,9 +941,11 @@ func (weh *workflowExecutionEventHandlerImpl) ProcessEvent(
940
941
return err
941
942
}
942
943
943
- historySizeErr := weh .estimateHistorySize (event )
944
- if historySizeErr != nil {
945
- weh .logger .Error ("Failed to estimate history size" , zap .Error (historySizeErr ))
944
+ if ! isReplay {
945
+ historySizeErr := weh .estimateHistorySize (event )
946
+ if historySizeErr != nil {
947
+ weh .logger .Error ("Failed to estimate history size" , zap .Error (historySizeErr ))
948
+ }
946
949
}
947
950
948
951
// When replaying histories to get stack trace or current state the last event might be not
@@ -1386,7 +1389,7 @@ func (weh *workflowExecutionEventHandlerImpl) handleSignalExternalWorkflowExecut
1386
1389
}
1387
1390
1388
1391
func (weh * workflowExecutionEventHandlerImpl ) estimateHistorySize (event * m.HistoryEvent ) error {
1389
- sum := 0
1392
+ sum := historySizeEstimationBuffer
1390
1393
switch event .GetEventType () {
1391
1394
case m .EventTypeWorkflowExecutionStarted :
1392
1395
if event .WorkflowExecutionStartedEventAttributes != nil {
You can’t perform that action at this time.
0 commit comments