Skip to content

opt: close file descriptor after OnClose()#622

Merged
panjf2000 merged 1 commit into
devfrom
close-opt
Jul 3, 2024
Merged

opt: close file descriptor after OnClose()#622
panjf2000 merged 1 commit into
devfrom
close-opt

Conversation

@panjf2000

Copy link
Copy Markdown
Owner

Fixes #621

@github-actions github-actions Bot added the enhancement New feature or request label Jul 3, 2024
@codecov

codecov Bot commented Jul 3, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 28.57143% with 10 lines in your changes missing coverage. Please review.

Project coverage is 80.76%. Comparing base (8a80aaf) to head (b7aef26).

Files Patch % Lines
eventloop_unix.go 28.57% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #622      +/-   ##
==========================================
- Coverage   80.89%   80.76%   -0.13%     
==========================================
  Files          21       21              
  Lines        2109     2116       +7     
==========================================
+ Hits         1706     1709       +3     
- Misses        273      276       +3     
- Partials      130      131       +1     
Flag Coverage Δ
unittests 80.76% <28.57%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@panjf2000 panjf2000 added bug Something isn't working optimization Some small optimizations labels Jul 3, 2024
@panjf2000 panjf2000 merged commit 1ed4d08 into dev Jul 3, 2024
@panjf2000 panjf2000 deleted the close-opt branch July 3, 2024 02:54
panjf2000 added a commit that referenced this pull request Jul 3, 2024
panjf2000 added a commit that referenced this pull request Jul 3, 2024
Updates #621

Follows up #622

This PR also refines `eventloop.close()` and fixes the potential UDP socket leaks for Windows clients.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request optimization Some small optimizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: socket fd being reused during OnClose() lead to data corruption

1 participant