Fixes issues with RetryExpirationTime convertion
@@ -790,7 +790,6 @@ func InternalWorkflowExecutionInfoToProto(executionInfo *InternalWorkflowExecuti
RetryMaximumIntervalSeconds: executionInfo.MaximumInterval,
RetryMaximumAttempts: executionInfo.MaximumAttempts,
RetryExpirationSeconds: executionInfo.ExpirationSeconds,
- RetryExpirationTimeNanos: executionInfo.ExpirationTime.UnixNano(),
RetryNonRetryableErrors: executionInfo.NonRetriableErrors,
EventStoreVersion: EventStoreVersion,
EventBranchToken: executionInfo.BranchToken,
@@ -800,6 +799,10 @@ func InternalWorkflowExecutionInfoToProto(executionInfo *InternalWorkflowExecuti
Memo: executionInfo.Memo,
}
+ if !executionInfo.ExpirationTime.IsZero() {
+ info.RetryExpirationTimeNanos = executionInfo.ExpirationTime.UnixNano()
+ }
+
completionEvent := executionInfo.CompletionEvent
if completionEvent != nil {
info.CompletionEvent = completionEvent.Data
@@ -880,7 +883,6 @@ func ProtoWorkflowExecutionToPartialInternalExecution(info *persistenceblobs.Wor
MaximumInterval: info.GetRetryMaximumIntervalSeconds(),
MaximumAttempts: info.GetRetryMaximumAttempts(),
ExpirationSeconds: info.GetRetryExpirationSeconds(),
- ExpirationTime: time.Unix(0, info.GetRetryExpirationTimeNanos()),
BranchToken: info.GetEventBranchToken(),
ExecutionContext: info.GetExecutionContext(),
NonRetriableErrors: info.GetRetryNonRetryableErrors(),
@@ -888,6 +890,10 @@ func ProtoWorkflowExecutionToPartialInternalExecution(info *persistenceblobs.Wor
Memo: info.GetMemo(),
}
+ if info.GetRetryExpirationTimeNanos() != 0 {
+ executionInfo.ExpirationTime = time.Unix(0, info.GetRetryExpirationTimeNanos())
+ }
+
if info.ParentDomainID != nil {
executionInfo.ParentDomainID = primitives.UUID(info.ParentDomainID).String()
executionInfo.ParentWorkflowID = info.GetParentWorkflowID()
@@ -945,13 +951,15 @@ func ProtoActivityInfoToInternalActivityInfo(decoded *persistenceblobs.ActivityI
InitialInterval: decoded.GetRetryInitialIntervalSeconds(),
BackoffCoefficient: decoded.GetRetryBackoffCoefficient(),
MaximumInterval: decoded.GetRetryMaximumIntervalSeconds(),
- ExpirationTime: time.Unix(0, decoded.GetRetryExpirationTimeNanos()),
MaximumAttempts: decoded.GetRetryMaximumAttempts(),
NonRetriableErrors: decoded.GetRetryNonRetryableErrors(),
LastFailureReason: decoded.GetRetryLastFailureReason(),
LastWorkerIdentity: decoded.GetRetryLastWorkerIdentity(),
LastFailureDetails: decoded.GetRetryLastFailureDetails(),
}
+ if decoded.GetRetryExpirationTimeNanos() != 0 {
+ info.ExpirationTime = time.Unix(0, decoded.GetRetryExpirationTimeNanos())
+ }
if decoded.StartedEvent != nil {
info.StartedEvent = NewDataBlob(decoded.StartedEvent, common.EncodingType(decoded.GetStartedEventEncoding()))
}
@@ -992,13 +1000,15 @@ func (v *InternalActivityInfo) ToProto() *persistenceblobs.ActivityInfo {
RetryInitialIntervalSeconds: v.InitialInterval,
RetryBackoffCoefficient: v.BackoffCoefficient,
RetryMaximumIntervalSeconds: v.MaximumInterval,
- RetryExpirationTimeNanos: v.ExpirationTime.UnixNano(),
RetryMaximumAttempts: v.MaximumAttempts,
RetryNonRetryableErrors: v.NonRetriableErrors,
RetryLastFailureReason: v.LastFailureReason,
RetryLastWorkerIdentity: v.LastWorkerIdentity,
RetryLastFailureDetails: v.LastFailureDetails,
}
+ if !v.ExpirationTime.IsZero() {
+ info.RetryExpirationTimeNanos = v.ExpirationTime.UnixNano()
+ }
return info
}
