Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We now do not log on recent shard closed errors from the getWorkflowExecutionWithRetry function #6068

Merged
merged 2 commits into from
May 30, 2024

Conversation

jakobht
Copy link
Contributor

@jakobht jakobht commented May 29, 2024

What changed?
We now do not log on recent shard closed errors from the getWorkflowExecutionWithRetry function, for other errors we still log all

Why?
Shard closed error are expected for a short time after a shard has been stolen, so there is no reason to do error logs on it for the first short while.

How did you test it?
Unit tests

Potential risks
Minimal only touches logging logic

Release notes

Documentation Changes

Copy link

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.15%. Comparing base (2f08de5) to head (18ad578).
Report is 6 commits behind head on master.

Current head 18ad578 differs from pull request most recent head 6ee642c

Please upload reports for the commit 6ee642c to get more accurate results.

Additional details and impacted files
Files Coverage Δ
service/history/execution/context.go 84.86% <100.00%> (+0.04%) ⬆️

... and 13 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f08de5...6ee642c. Read the comment docs.

// If error is shard closed, only log error if shard has been closed for a while,
// otherwise always log
var shardClosedError *shard.ErrShardClosed
if !errors.As(err, &shardClosedError) || time.Since(shardClosedError.ClosedAt) > shard.TimeBeforeShardClosedIsError {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use timesource here instead of time.Since

Copy link
Contributor

@3vilhamster 3vilhamster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not use time.Since/time.Now. I suggest using timesource in this case.

@jakobht jakobht merged commit dd54cd0 into uber:master May 30, 2024
18 checks passed
timl3136 pushed a commit to timl3136/cadence that referenced this pull request Jun 6, 2024
…xecutionWithRetry function (uber#6068)

* We now do not log on recent shard closed errors from the getWorkflowExecutionWithRetry function

* Changed to use timeSource instead of time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants