-
Notifications
You must be signed in to change notification settings - Fork 118
ProfilesCache does not handle race conditions #2831
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingpriority-highProduction outage - this quarter or at least next quarterProduction outage - this quarter or at least next quarterseverity-highBug for which there may be workaround but limits the usage of the Zowe for major use casesBug for which there may be workaround but limits the usage of the Zowe for major use cases
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority-highProduction outage - this quarter or at least next quarterProduction outage - this quarter or at least next quarterseverity-highBug for which there may be workaround but limits the usage of the Zowe for major use casesBug for which there may be workaround but limits the usage of the Zowe for major use cases
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the bug
Although JavaScript and Node.js are single-threaded, multiple VS Code extensions can activate in parallel. Extensions that grab the static
ProfilesCacheinstance from Zowe Explorer might compete with one another when performing operations on the cache (such asrefresh), causing undefined behavior in the cache (such as missing or incorrect profile values, etc.)To Reproduce
Have two or more extensions that access the
ProfilesCacheinstance through Zowe Explorer's extension exports (vscode.extensions.getExtension("zowe.vscode-extension-for-zowe").exports). Try to callrefreshon this cache instance for each extension, as soon as the extensions are activated.Expected behavior
The ProfilesCache instance should fill the cache successfully during refresh, and return an instance with valid profiles.
Desktop (please complete the following information):
Additional context
A few internal developers have reported this issue. Due to the nature of VS Code extensions and asynchronous code in Node.js, we likely need to add multi-threading support to prevent any problems that may surface from ProfilesCache race conditions.