Skip to content

Fix EventOutCh deadlock by making publish non-blocking#663

Merged
openshift-merge-bot[bot] merged 1 commit intoredhat-cne:mainfrom
jzding:socket-fix
Apr 13, 2026
Merged

Fix EventOutCh deadlock by making publish non-blocking#663
openshift-merge-bot[bot] merged 1 commit intoredhat-cne:mainfrom
jzding:socket-fix

Conversation

@jzding
Copy link
Copy Markdown
Member

@jzding jzding commented Apr 10, 2026

PublishEventViaAPI sends to EventOutCh with a blocking channel send. When ProcessOutChannel (the consumer) is slow due to HTTP POST failures (e.g., unreachable subscribers), the 100-slot buffer fills up and the next publish blocks forever. This deadlocks the processMessages goroutine, freezing socket I/O and causing cloud-event-proxy to hang silently.

Fix by using select with default to drop events when the channel is full instead of blocking indefinitely. Dropped events are logged as warnings and counted as failures in metrics.

@jzding
Copy link
Copy Markdown
Member Author

jzding commented Apr 10, 2026

/gemini review

Comment thread pkg/common/common.go Outdated
PublishEventViaAPI sends to EventOutCh with a blocking channel send.
When ProcessOutChannel (the consumer) is slow due to HTTP POST failures
(e.g., unreachable subscribers), the 100-slot buffer fills up and the
next publish blocks forever. This deadlocks the processMessages
goroutine, freezing socket I/O and causing cloud-event-proxy to hang
silently.

Fix by using select with default to drop events when the channel is
full instead of blocking indefinitely. Dropped events are logged as
warnings and counted as failures in metrics.

Signed-off-by: Jack Ding <jackding@gmail.com>
Copy link
Copy Markdown
Contributor

@nocturnalastro nocturnalastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 13, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jzding, nocturnalastro

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [jzding,nocturnalastro]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jzding
Copy link
Copy Markdown
Member Author

jzding commented Apr 13, 2026

/verified later @dpopsuev

@openshift-ci-robot
Copy link
Copy Markdown

@jzding: This PR has been marked to be verified later by @dpopsuev.

Details

In response to this:

/verified later @dpopsuev

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-bot openshift-merge-bot Bot merged commit 409bff2 into redhat-cne:main Apr 13, 2026
8 of 14 checks passed
@jzding
Copy link
Copy Markdown
Member Author

jzding commented Apr 15, 2026

/cherry-pick release-4.22

@openshift-cherrypick-robot
Copy link
Copy Markdown

@jzding: new pull request created: #664

Details

In response to this:

/cherry-pick release-4.22

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants