redpanda-data / redpanda-data/connect

Consider clearing errors at the beginning of a try block

Open
#1,121 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement processors ux v4
Dominant language
Go
Stars
8.8k
Forks
969
Avg merge
1d 13h
Merged PRs (30d)
64

Description

Right now nested try blocks within catch will never trigger:

pipeline:
  processors:
    - try:
      - resource: foo
    - catch:
      - try:
        - resource: bar
        - resource: baz

So if foo fails neither bar nor baz would execute. This is because the error context is carried into the processors of the catch block and aren't cleared until the end so that the error message can be referrenced. A work around is to add a nested catch before the try block:

pipeline:
  processors:
    - try:
      - resource: foo
    - catch:
      - catch: []
      - try:
        - resource: bar
        - resource: baz

This clears the error before the try block but looks odd and ugly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the nested YAML pipeline with try, catch, and the foo, bar, and baz resources. Trace how the error context moves through these pipeline processors and determine how clearing it at the start of a try should affect nested execution. Done means bar and baz run after foo fails without requiring an empty nested catch, while the original error remains available for the catch block.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.