Skip to content

Commit

Permalink
[Nexus] Add logs when failed to parse links (#6447)
Browse files Browse the repository at this point in the history
## What changed?
<!-- Describe what has changed in this PR -->
Add logs to errors failing to parse links.

## Why?
<!-- Tell your future self why have you made these changes -->

## 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) -->
  • Loading branch information
rodrigozhou authored and dnr committed Oct 4, 2024
1 parent 9cbb79f commit a505b1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion components/nexusoperations/executors.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,12 @@ func (e taskExecutor) saveResult(ctx context.Context, env hsm.Environment, ref h
case string((&commonpb.Link_WorkflowEvent{}).ProtoReflect().Descriptor().FullName()):
link, err := ConvertNexusLinkToLinkWorkflowEvent(nexusLink)
if err != nil {
// silently ignore for now
// TODO(rodrigozhou): links are non-essential for the execution of the workflow,
// so ignoring the error for now; we will revisit how to handle these errors later.
e.Logger.Error(
fmt.Sprintf("failed to parse link to %q: %s", nexusLink.Type, nexusLink.URL),
tag.Error(err),
)
continue
}
links = append(links, &commonpb.Link{
Expand Down
4 changes: 3 additions & 1 deletion service/frontend/nexus_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ func (h *nexusHandler) StartOperation(
for _, link := range t.AsyncSuccess.GetLinks() {
linkURL, err := url.Parse(link.Url)
if err != nil {
// silently ignore for now
// TODO(rodrigozhou): links are non-essential for the execution of the workflow,
// so ignoring the error for now; we will revisit how to handle these errors later.
oc.logger.Error(fmt.Sprintf("failed to parse link url: %s", link.Url), tag.Error(err))
continue
}
nexusLinks = append(nexusLinks, nexus.Link{
Expand Down

0 comments on commit a505b1a

Please sign in to comment.