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

fix(app/log): prevent close of closed channel #2296

Merged
merged 4 commits into from
Feb 6, 2023
Merged

fix(app/log): prevent close of closed channel #2296

merged 4 commits into from
Feb 6, 2023

Conversation

yin1999
Copy link
Contributor

@yin1999 yin1999 commented Feb 3, 2023

Fixes: #2282

The close of done channel may be called many times. And the handler will be blocked when the log client exists and the closure func is still not be called.

So use context to resolve those two problems.

@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2023

Codecov Report

Base: 39.23% // Head: 39.20% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (1e235db) compared to base (75ece5b).
Patch coverage: 0.00% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2296      +/-   ##
==========================================
- Coverage   39.23%   39.20%   -0.03%     
==========================================
  Files         617      617              
  Lines       36833    36825       -8     
==========================================
- Hits        14453    14439      -14     
- Misses      20791    20793       +2     
- Partials     1589     1593       +4     
Impacted Files Coverage Δ
app/log/command/command.go 10.52% <0.00%> (-0.29%) ⬇️
app/proxyman/outbound/errors.generated.go 0.00% <0.00%> (-100.00%) ⬇️
common/task/task.go 88.88% <0.00%> (-7.41%) ⬇️
app/proxyman/outbound/handler.go 35.61% <0.00%> (-4.11%) ⬇️
transport/internet/websocket/connection.go 16.51% <0.00%> (-3.67%) ⬇️
transport/internet/kcp/listener.go 81.18% <0.00%> (-1.99%) ⬇️
common/session/context.go 56.66% <0.00%> (-1.67%) ⬇️
proxy/vmess/outbound/outbound.go 58.26% <0.00%> (-1.58%) ⬇️
transport/internet/kcp/receiving.go 97.31% <0.00%> (-1.35%) ⬇️
app/dns/config.pb.go 12.63% <0.00%> (ø)
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@AkinoKaede AkinoKaede requested a review from kslr February 3, 2023 09:06
mydogshitgold and others added 3 commits February 5, 2023 20:42
The close of `done` channel may be called many times.
And the handler will be blocked when the log client exists and the
closure func is still not be called.
So use context to resolve those two problems.
@xiaokangwang xiaokangwang merged commit beec73e into v2fly:master Feb 6, 2023
@yin1999 yin1999 deleted the fix-log branch February 6, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LoggerService caused panic: close of closed channel.
5 participants