Skip to content

ProfilesCache does not handle race conditions #2831

@traeok

Description

@traeok

Describe the bug

Although JavaScript and Node.js are single-threaded, multiple VS Code extensions can activate in parallel. Extensions that grab the static ProfilesCache instance from Zowe Explorer might compete with one another when performing operations on the cache (such as refresh), causing undefined behavior in the cache (such as missing or incorrect profile values, etc.)

To Reproduce

Have two or more extensions that access the ProfilesCache instance through Zowe Explorer's extension exports (vscode.extensions.getExtension("zowe.vscode-extension-for-zowe").exports). Try to call refresh on 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):

  • OS: Windows
  • Zowe Explorer Version: 2.15.2

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority-highProduction 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 cases

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions