Skip to content

Commit

Permalink
[frontend] Always log CheckEventBlobSizeLimit violations (#6183)
Browse files Browse the repository at this point in the history
* [frontend] Always log CheckEventBlobSizeLimit violations

* also newWorkflowSizeChecker to always log failures
  • Loading branch information
3vilhamster authored Jul 24, 2024
1 parent 95ba44c commit b85c66e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions service/frontend/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ func (wh *WorkflowHandler) RecordActivityTaskHeartbeat(
taskToken.WorkflowID,
taskToken.RunID,
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RecordActivityTaskHeartbeat"),
); err != nil {
// heartbeat details exceed size limit, we would fail the activity immediately with explicit error reason
Expand Down Expand Up @@ -879,7 +879,7 @@ func (wh *WorkflowHandler) RecordActivityTaskHeartbeatByID(
taskToken.WorkflowID,
taskToken.RunID,
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RecordActivityTaskHeartbeatByID"),
); err != nil {
// heartbeat details exceed size limit, we would fail the activity immediately with explicit error reason
Expand Down Expand Up @@ -976,7 +976,7 @@ func (wh *WorkflowHandler) RespondActivityTaskCompleted(
taskToken.WorkflowID,
taskToken.RunID,
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RespondActivityTaskCompleted"),
); err != nil {
// result exceeds blob size limit, we would record it as failure
Expand Down Expand Up @@ -1081,7 +1081,7 @@ func (wh *WorkflowHandler) RespondActivityTaskCompletedByID(
taskToken.WorkflowID,
taskToken.RunID,
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RespondActivityTaskCompletedByID"),
); err != nil {
// result exceeds blob size limit, we would record it as failure
Expand Down Expand Up @@ -1177,7 +1177,7 @@ func (wh *WorkflowHandler) RespondActivityTaskFailed(
taskToken.WorkflowID,
taskToken.RunID,
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RespondActivityTaskFailed"),
); err != nil {
// details exceeds blob size limit, we would truncate the details and put a specific error reason
Expand Down Expand Up @@ -1271,7 +1271,7 @@ func (wh *WorkflowHandler) RespondActivityTaskFailedByID(
taskToken.WorkflowID,
taskToken.RunID,
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RespondActivityTaskFailedByID"),
); err != nil {
// details exceeds blob size limit, we would truncate the details and put a specific error reason
Expand Down Expand Up @@ -1358,7 +1358,7 @@ func (wh *WorkflowHandler) RespondActivityTaskCanceled(
taskToken.WorkflowID,
taskToken.RunID,
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RespondActivityTaskCanceled"),
); err != nil {
// details exceeds blob size limit, we would record it as failure
Expand Down Expand Up @@ -1463,7 +1463,7 @@ func (wh *WorkflowHandler) RespondActivityTaskCanceledByID(
taskToken.WorkflowID,
taskToken.RunID,
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RespondActivityTaskCanceledByID"),
); err != nil {
// details exceeds blob size limit, we would record it as failure
Expand Down Expand Up @@ -1650,7 +1650,7 @@ func (wh *WorkflowHandler) RespondDecisionTaskFailed(
taskToken.WorkflowID,
taskToken.RunID,
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RespondDecisionTaskFailed"),
); err != nil {
// details exceed, we would just truncate the size for decision task failed as the details is not used anywhere by client code
Expand Down Expand Up @@ -1715,7 +1715,7 @@ func (wh *WorkflowHandler) RespondQueryTaskCompleted(
"",
"",
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("RespondQueryTaskCompleted"),
); err != nil {
completeRequest = &types.RespondQueryTaskCompletedRequest{
Expand Down Expand Up @@ -1956,7 +1956,7 @@ func (wh *WorkflowHandler) validateStartWorkflowExecutionRequest(ctx context.Con
startRequest.GetWorkflowID(),
"",
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("StartWorkflowExecution"),
); err != nil {
return err
Expand Down Expand Up @@ -2306,7 +2306,7 @@ func (wh *WorkflowHandler) SignalWorkflowExecution(
signalRequest.GetWorkflowExecution().GetWorkflowID(),
signalRequest.GetWorkflowExecution().GetRunID(),
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("SignalWorkflowExecution"),
); err != nil {
return err
Expand Down Expand Up @@ -2539,7 +2539,7 @@ func (wh *WorkflowHandler) validateSignalWithStartWorkflowExecutionRequest(ctx c
signalWithStartRequest.GetWorkflowID(),
"",
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("SignalWithStartWorkflowExecution"),
); err != nil {
return err
Expand All @@ -2553,7 +2553,7 @@ func (wh *WorkflowHandler) validateSignalWithStartWorkflowExecutionRequest(ctx c
signalWithStartRequest.GetWorkflowID(),
"",
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("SignalWithStartWorkflowExecution"),
); err != nil {
return err
Expand Down Expand Up @@ -3449,7 +3449,7 @@ func (wh *WorkflowHandler) QueryWorkflow(
queryRequest.GetExecution().GetWorkflowID(),
queryRequest.GetExecution().GetRunID(),
scope,
wh.GetThrottledLogger(),
wh.GetLogger(),
tag.BlobSizeViolationOperation("QueryWorkflow")); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion service/history/decision/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ Update_History_Loop:
msBuilder,
executionStats,
handler.metricsClient.Scope(metrics.HistoryRespondDecisionTaskCompletedScope, metrics.DomainTag(domainName)),
handler.throttledLogger,
handler.logger,
)

decisionTaskHandler := newDecisionTaskHandler(
Expand Down

0 comments on commit b85c66e

Please sign in to comment.