Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make Logger.WriteLine thread-safe and fix bug with UNC paths #4276

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
andyleejordan merged 2 commits into main from andschwa/lock-logger
Nov 21, 2022

Conversation

Copy link
Member

@andyleejordan andyleejordan commented Nov 21, 2022

This adds a simple lock to Logger.WriteLine since it's not re-entrant, hence we were losing logs. Now concurrent calls to it wait for each other to finish. It also should fix #4202, as the bug appears to be with the scheme used in globalStorageUri being vscode-userdata instead of file, and vscode.Uri.fsPath claiming it does not care about the scheme, but in fact essentially requires it to be file.

When we moved to using `globalStorageUri` and passing `vscode.Uri`s
around, we did not test UNC shares. It turns out that while
`vscode.Uri.fsPath`'s documentation says that it "does not look at
scheme," it actually does look at the scheme and essentially requires it
to be `file`. The scheme of the `globalStorageUri` however is
`vscode-userdata`, so the `fsPath` fails to then handle the UNC share
path. We are now replacing the scheme with `file` to get around this bug.
@andyleejordan andyleejordan requested a review from a team November 21, 2022 21:30
@ghost ghost added the Issue-Bug A bug to squash. label Nov 21, 2022
Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

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

LGTM! Well done getting this figured out ❤️

@andyleejordan andyleejordan deleted the andschwa/lock-logger branch November 21, 2022 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@SeeminglyScience SeeminglyScience SeeminglyScience approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

VSCode Extension v2022.8.5 initializes wrong user profile path

AltStyle によって変換されたページ (->オリジナル) /