-
Notifications
You must be signed in to change notification settings - Fork 197
💥 Use Temporal Failures for Nexus Error Serialization #2773
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
base: master
Are you sure you want to change the base?
Changes from all commits
296f927
8607ddb
0dec89d
3b8fe5e
4219704
3495885
3d44cf5
9545fd2
6d50161
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ plugins { | |
|
|
||
| allprojects { | ||
| repositories { | ||
| mavenLocal() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SNAPSHOT dependency and mavenLocal not suitable for mergeMedium Severity
Additional Locations (1) |
||
| mavenCentral() | ||
| } | ||
| } | ||
|
|
@@ -30,7 +31,7 @@ ext { | |
| // Platforms | ||
| grpcVersion = '1.75.0' // [1.38.0,) Needed for io.grpc.protobuf.services.HealthStatusManager | ||
| jacksonVersion = '2.15.4' // [2.9.0,) | ||
| nexusVersion = '0.4.0-alpha' | ||
| nexusVersion = '0.5.0-SNAPSHOT' | ||
Quinn-With-Two-Ns marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // we don't upgrade to 1.10.x because it requires kotlin 1.6. Users may use 1.10.x in their environments though. | ||
| micrometerVersion = project.hasProperty("edgeDepsTest") ? '1.13.6' : '1.9.9' // [1.0.0,) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| import io.temporal.common.converter.FailureConverter; | ||
| import io.temporal.internal.activity.ActivityTaskHandlerImpl; | ||
| import io.temporal.internal.common.FailureUtils; | ||
| import io.temporal.internal.common.NexusUtil; | ||
| import io.temporal.internal.common.ProtobufTimeUtils; | ||
| import io.temporal.internal.sync.POJOWorkflowImplementationFactory; | ||
| import io.temporal.serviceclient.CheckedExceptionWrapper; | ||
|
|
@@ -192,7 +193,18 @@ private RuntimeException failureToExceptionImpl(Failure failure, DataConverter d | |
| retryBehavior = HandlerException.RetryBehavior.NON_RETRYABLE; | ||
| break; | ||
| } | ||
| return new HandlerException(info.getType(), cause, retryBehavior); | ||
| if (failure | ||
| .getMessage() | ||
| .startsWith(String.format("handler error (%s)", info.getType()))) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand this is here to allow proper decoding of legacy errors, but for which languages exactly? If we mean to support legacy errors coming from Go or others, are we sure the casing returned by
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any old failure serialized by Go or Java. This is the handler error type so that should match the Nexus spec and consistent across Go and Java |
||
| return new HandlerException(info.getType(), cause, retryBehavior); | ||
| } else { | ||
| return new HandlerException( | ||
| info.getType(), | ||
| failure.getMessage(), | ||
| cause, | ||
| retryBehavior, | ||
| NexusUtil.temporalFailureToNexusFailureInfo(failure)); | ||
| } | ||
| } | ||
| case FAILUREINFO_NOT_SET: | ||
| default: | ||
|
|
@@ -324,6 +336,9 @@ private Failure exceptionToFailure(Throwable throwable) { | |
| failure.setNexusOperationExecutionFailureInfo(op); | ||
| } else if (throwable instanceof HandlerException) { | ||
| HandlerException he = (HandlerException) throwable; | ||
| if (he.getOriginalFailure() != null) { | ||
| return NexusUtil.nexusFailureToAPIFailure(he.getOriginalFailure(), true); | ||
| } | ||
| NexusHandlerErrorRetryBehavior retryBehavior = | ||
| NexusHandlerErrorRetryBehavior.NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_UNSPECIFIED; | ||
| switch (he.getRetryBehavior()) { | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.