argoproj / argo-events

Event-driven Automation Framework for Kubernetes
https://argoproj.github.io/argo-events/
Apache License 2.0
2.38k stars 742 forks source link

EOF logged as error while receiving eventstream in generic event source #3182

Open jdaftari-confluent opened 5 months ago

jdaftari-confluent commented 5 months ago

Describe the bug The generic eventsource client logs an error when it receives and io.EOF on the stream. This is a valid response indicating that the stream has completed successfully and should not be logged as an error.

To Reproduce Steps to reproduce the behavior:

  1. Implement a generic event source server that implements generic.proto. The server sends a nil for error indicating there's no error and the stream has finished.
  2. Deploy the event bus, the event source server and configure the generic eventsource to connect to the server.
  3. Once the generic eventsource client starts streaming from the server, you'll notice this error.

Expected behavior No error logs when io.EOF is received because EOF on the Recv method indicates that the stream completed successfully.

Screenshots N/A

Environment (please complete the following information):

Additional context

Log
{
    "level": "error",
    "ts": 1719377580.1872804,
    "logger": "argo-events.eventsource",
    "caller": "generic/start.go:82",
    "msg": "failed to receive events from the event stream, reconnecting in 5 seconds...",
    "eventSourceName": "foo",
    "eventSourceType": "generic",
    "eventName": "bar",
    "url": "foo.argo-events.svc:50051",
    "error": "EOF",
    "stacktrace": "github.com/argoproj/argo-events/eventsources/sources/generic.(*EventListener).StartListening\n\t/home/build/eventsources/sources/generic/start.go:82\ngithub.com/argoproj/argo-events/eventsources.(*EventSourceAdaptor).run.func3.1\n\t/home/build/eventsources/eventing.go:536\ngithub.com/argoproj/argo-events/common.DoWithRetry.func1\n\t/home/build/common/retry.go:106\nk8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtection.ConditionFunc.WithContext.func1\n\t/var/cache/melange/gomodcache/k8s.io/apimachinery@v0.24.3/pkg/util/wait/wait.go:220\nk8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext\n\t/var/cache/melange/gomodcache/k8s.io/apimachinery@v0.24.3/pkg/util/wait/wait.go:233\nk8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtection\n\t/var/cache/melange/gomodcache/k8s.io/apimachinery@v0.24.3/pkg/util/wait/wait.go:226\nk8s.io/apimachinery/pkg/util/wait.ExponentialBackoff\n\t/var/cache/melange/gomodcache/k8s.io/apimachinery@v0.24.3/pkg/util/wait/wait.go:421\ngithub.com/argoproj/argo-events/common.DoWithRetry\n\t/home/build/common/retry.go:105\ngithub.com/argoproj/argo-events/eventsources.(*EventSourceAdaptor).run.func3\n\t/home/build/eventsources/eventing.go:535"
}
Stacktrace
github.com/argoproj/argo-events/eventsources/sources/generic.(*EventListener).StartListening
        /home/build/eventsources/sources/generic/start.go:82
github.com/argoproj/argo-events/eventsources.(*EventSourceAdaptor).run.func3.1
        /home/build/eventsources/eventing.go:536
github.com/argoproj/argo-events/common.DoWithRetry.func1
        /home/build/common/retry.go:106
k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtection.ConditionFunc.WithContext.func1
        /var/cache/melange/gomodcache/k8s.io/apimachinery@v0.24.3/pkg/util/wait/wait.go:220
k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext
        /var/cache/melange/gomodcache/k8s.io/apimachinery@v0.24.3/pkg/util/wait/wait.go:233
k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtection
        /var/cache/melange/gomodcache/k8s.io/apimachinery@v0.24.3/pkg/util/wait/wait.go:226
k8s.io/apimachinery/pkg/util/wait.ExponentialBackoff
        /var/cache/melange/gomodcache/k8s.io/apimachinery@v0.24.3/pkg/util/wait/wait.go:421
github.com/argoproj/argo-events/common.DoWithRetry
        /home/build/common/retry.go:105
github.com/argoproj/argo-events/eventsources.(*EventSourceAdaptor).run.func3
        /home/build/eventsources/eventing.go:535

Message from the maintainers:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. It will be closed if no further activity occurs. Thank you for your contributions.

justinfx commented 3 months ago

:bump:

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. It will be closed if no further activity occurs. Thank you for your contributions.

justinfx commented 1 month ago

:bump: