Skip to content

Commit f7673e7

Browse files
authored
Return error for non retry case in stream sender (temporalio#7478)
## What changed? Return error for non retry case in stream sender ## Why? recvSyncReplicationState can return stream error or sol error ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) -->
1 parent 58a82d4 commit f7673e7

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

service/history/replication/stream.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ import (
3636
"go.temporal.io/server/common/log"
3737
"go.temporal.io/server/common/log/tag"
3838
"go.temporal.io/server/common/metrics"
39-
"go.temporal.io/server/service/history/shard"
39+
"go.temporal.io/server/common/persistence"
40+
serviceerrors "go.temporal.io/server/common/serviceerror"
4041
)
4142

4243
var (
@@ -111,11 +112,15 @@ func WrapEventLoop(
111112
}
112113

113114
func isRetryableError(err error) bool {
114-
if shard.IsShardOwnershipLostError(err) {
115+
var streamError *StreamError
116+
var shardOwnershipLostError *persistence.ShardOwnershipLostError
117+
var shardOwnershipLost *serviceerrors.ShardOwnershipLost
118+
switch {
119+
case errors.As(err, &shardOwnershipLostError):
115120
return false
116-
}
117-
switch err.(type) {
118-
case *StreamError:
121+
case errors.As(err, &shardOwnershipLost):
122+
return false
123+
case errors.As(err, &streamError):
119124
return false
120125
default:
121126
return true

0 commit comments

Comments
 (0)