Skip to content

fix: add nil check in deer-go LoggerCallback to prevent blocking #89

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

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

icyclv
Copy link
Contributor

@icyclv icyclv commented Jul 19, 2025

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
This PR fixes a potential blocking issue in the LoggerCallback component by adding a nil check before writing to the Out channel. Due to the Out channel not being set in server mode, the server mode of deer-go is unable to run properly.

zh(optional):

(Optional) Which issue(s) this PR fixes:

Fixes #87 #88

(optional) The PR that updates user documentation:

@CLAassistant
Copy link

CLAassistant commented Jul 19, 2025

CLA assistant check
All committers have signed the CLA.

@meguminnnnnnnnn
Copy link
Contributor

这个是要防止 panic 吗, 如果是 nil 的话应该不会 block?

Copy link
Contributor

@meguminnnnnnnnn meguminnnnnnnnn left a comment

Choose a reason for hiding this comment

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

LGTM

@meguminnnnnnnnn meguminnnnnnnnn merged commit 928dd90 into cloudwego:main Jul 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

deer-go 的后端 server 调用 stream 阻塞问题
3 participants