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 dotnetspy panic on premature exit and add tests. #203

Merged
merged 1 commit into from
May 21, 2021

Conversation

kolesnikovae
Copy link
Collaborator

There is a case when dotnetspy couldn't establish a connection to Diagnostics Server before the next snapshot/stop call (e.g, target process exited, or the socket file cannot be found, etc).

This fix adds a check whether the session has been actually created before accessing it. Given that there are no race conditions between reset/stop/snapshot calls, redundant mutexes were removed.

There is a case when dotnetspy couldn't establish a connection to
Diagnostics Server before the next snapshot/stop call (e.g, target
process exited, or the socket file cannot be found, etc).

This fix adds a check whether the session has been actually created
before accessing it. Given that there are no race conditions between
reset/stop/snapshot calls, redundant mutexes were removed.
@github-actions github-actions bot requested review from petethepig and Rperry2174 May 21, 2021 11:32
@kolesnikovae kolesnikovae self-assigned this May 21, 2021
@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #203 (03eb3e1) into main (0e8d6ff) will decrease coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #203      +/-   ##
==========================================
- Coverage   57.36%   57.29%   -0.06%     
==========================================
  Files          73       73              
  Lines        2943     2943              
==========================================
- Hits         1688     1686       -2     
- Misses       1110     1112       +2     
  Partials      145      145              
Impacted Files Coverage Δ
pkg/agent/session.go 63.94% <0.00%> (-3.27%) ⬇️
pkg/analytics/analytics.go 86.96% <0.00%> (+2.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f526ea...03eb3e1. Read the comment docs.

Copy link
Member

@petethepig petethepig left a comment

Choose a reason for hiding this comment

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

Looks good, merging

@petethepig petethepig merged commit b2fff2b into main May 21, 2021
@petethepig petethepig deleted the fix-dotnetspy-panic-on-premature-exit branch May 21, 2021 17:56
korniltsev pushed a commit that referenced this pull request Jul 18, 2023
…rrors

Close page after read and return errors properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants