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

Do not use memory mapped files on non-windows #74339

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

dibarbet
Copy link
Member

Different version of #73628
Resolves dotnet/vscode-csharp#7119

Memory mapped files on linux are saved to /dev/shm/ which has a tiny size by default in docker containers. This causes the server to crash. Fix is to only use memory mapped files when OOP is required (Windows).

@dibarbet dibarbet requested a review from a team as a code owner July 10, 2024 22:33
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 10, 2024
// Serialization to temporary storage is only involved when we have a remote process. Which is only in VS. So the type of the
// storage service here is well known. However the serializer is created in other cases (e.g. to compute project state checksums).
// So lazily instantiate the storage service to avoid attempting to get the TemporaryStorageService when not available.
_storageService = new Lazy<TemporaryStorageService>(() => (TemporaryStorageService)workspaceServices.GetRequiredService<ITemporaryStorageServiceInternal>());
Copy link
Member Author

Choose a reason for hiding this comment

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

A bit weird. the serializer service is almost only used for oop serialization - except its also used for create project parse option checksums on all platforms.

The TemporaryStorageService is not used in that case, so instantiating it lazily to avoid throwing when it attempts to convert to TemporaryStorageService


namespace Microsoft.CodeAnalysis;

internal sealed class TrivialTemporaryStorageService : ITemporaryStorageServiceInternal
Copy link
Member Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
3 participants