-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
// 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>()); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).