dotnet / dotnet/fsharp

Symbols API: full thread-safety

Open
#3,991 7 comments 0 reactions 0 assignees View on GitHub
Area-LangService-API Bug Impact-Medium
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

There're some APIs using which from multiple threads at the same time may lead to a dead lock or to an infinite looping.
I've seen this in several places and when attaching a debugger to a hanging process, it was hanging inside ``Dictionary`2``. (part of parallels stack screenshot is attached below).

I've seen it in `FSharpEntity.BaseType`, `FSharpMemberOrFunctionOrValue.XmlDocSig` and now in `FSharpChecker.GetProjectOptionsFromScript(...)`. Adding locks around uses of the first two APIs fixes the the issue for me. If needed I can remove the locks to reproduce it and provide stack traces.

Can we replace uses of `Dictionary` with `ConcurrentDictionary` in places that may be (indirectly) called by FCS clients?

screen shot 2017-11-21 at 16 54 43

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.