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

Zowe CLI looping in node.js task when interrupted. #1749

Open
oakmount66 opened this issue Jul 11, 2023 · 2 comments
Open

Zowe CLI looping in node.js task when interrupted. #1749

oakmount66 opened this issue Jul 11, 2023 · 2 comments
Labels
bug Something isn't working priority-low Legit issue but cosmetic or nice-to-have severity-medium Bug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex.

Comments

@oakmount66
Copy link

When a Zowe command is interrupted from a VScode extension, the related node.js task is not killed but starting to loop and using up t0 20% cpu.

In our local VScode extention we use Javascript function execSync with time out to issue Zowe CLI commands like:

const options = {
timeout: 20000
};
let command = 'zowe zos-tso send address-space asName --data "exec 'HIQ.MEQ.LOWQ(REXXPRG)' 'PARM1,PARM2,PARM3' exec" --reject-unauthorized false --response-format-json'
let response = execSync(command, options).toString().trim();

If the command isn't returning any response within 20 seconds or if VScode is closed while the command is awaiting, then a node.js task is left running on the local machine and after a short while the cpu consumption is raising to 15-20% per node.js task.

Details about the behavior:

  1. Command issued: zowe zso-tso send address-space
  2. Expected results: that the task is killed
  3. Actual results: node task/Zowe looping
  4. Applicable log files: ?

My environment

  • Zowe CLI version 7.16.4
  • VScode version 1.80.0
  • Node.js version 20.4.0
  • Npm version 9.7.2
  • Windows version 11
  • Daemon mode disabled:
@oakmount66 oakmount66 added bug Something isn't working new The issue wasn't triaged yet labels Jul 11, 2023
@github-actions
Copy link

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@awharn
Copy link
Member

awharn commented Jul 13, 2023

Thank you for the bug report. We have looked into this issue and found that there is currently a bug in the CLI that occurs when the execSync call times out and STDIN, STDOUT, and/or STDERR are removed from the process while the process is still running, which appears to be causing the continued high CPU and memory use that you describe.

In the meantime, we do offer Node SDKs that can be used in VSCode extensions, and do suggest they be used for your apparent use-case of a VSCode extension. This will allow people who do not have Zowe CLI installed to use your extension. Our API documentation is available here: https://docs.zowe.org/stable/typedoc/modules/_zowe_zos_tso_for_zowe_sdk.html

@JTonda JTonda added priority-low Legit issue but cosmetic or nice-to-have severity-medium Bug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex. and removed new The issue wasn't triaged yet labels Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-low Legit issue but cosmetic or nice-to-have severity-medium Bug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex.
Projects
Status: Low Priority
Development

No branches or pull requests

4 participants