Skip to content
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

The fallback output can panic when the input shuts down too quickly #159

Open
mihaitodor opened this issue Jan 15, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@mihaitodor
Copy link
Collaborator

Try running this config and press Ctrl+C after the first foo is printed:

input:
  generate:
    count: 0
    mapping: root = ""

output:
  fallback:
    - reject: "mihai"
    - stdout: {}
      processors:
        - sleep:
            duration: 3s
        - log:
            message: foo

shutdown_timeout: 2s

Note that you'll get the following panic:

$ benthos run foo.yaml
INFO Running main config from specified file       @service=redpanda-connect benthos_version="" path=foo.yaml
INFO Listening for HTTP requests at: http://0.0.0.0:4195  @service=redpanda-connect
INFO Input type generate is now active             @service=redpanda-connect label="" path=root.input
INFO Launching a Redpanda Connect instance, use CTRL+C to close  @service=redpanda-connect
INFO Output type stdout is now active              @service=redpanda-connect label="" path=root.output.fallback.1
INFO Output type reject is now active              @service=redpanda-connect label="" path=root.output.fallback.0
INFO foo                                           @service=redpanda-connect custom_source=true label="" path=root.output.fallback.1.processors.1

^CINFO Received SIGINT, the service is closing       @service=redpanda-connect
panic: send on closed channel

goroutine 39 [running]:
github.com/redpanda-data/benthos/v4/internal/impl/pure.(*fallbackBroker).loop.func3({0x109938488, 0x14000d90050}, {0x1098a9038?, 0x140026081b0?})
	/Users/mihaitodor/go/pkg/mod/github.com/redpanda-data/benthos/[email protected]/internal/impl/pure/output_fallback.go:232 +0x134
github.com/redpanda-data/benthos/v4/internal/message.(*Transaction).Ack(0x14002292ac0?, {0x109938488?, 0x14000d90050?}, {0x1098a9038?, 0x140026081b0?})
	/Users/mihaitodor/go/pkg/mod/github.com/redpanda-data/benthos/[email protected]/internal/message/transaction.go:90 +0xd8
github.com/redpanda-data/benthos/v4/internal/component/output.(*AsyncWriter).loop.func4()
	/Users/mihaitodor/go/pkg/mod/github.com/redpanda-data/benthos/[email protected]/internal/component/output/async_writer.go:244 +0xd8
created by github.com/redpanda-data/benthos/v4/internal/component/output.(*AsyncWriter).loop in goroutine 71
	/Users/mihaitodor/go/pkg/mod/github.com/redpanda-data/benthos/[email protected]/internal/component/output/async_writer.go:249 +0x578
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant