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

Issue with new Daemon and Emacs start-process on Windows #1318

Open
Trisk3lion opened this issue Feb 18, 2022 · 5 comments
Open

Issue with new Daemon and Emacs start-process on Windows #1318

Trisk3lion opened this issue Feb 18, 2022 · 5 comments
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits

Comments

@Trisk3lion
Copy link

Trisk3lion commented Feb 18, 2022

Hello

I'm using Zowe CLI with Emacs for enhancing my development workflow when developing mainframe applications with Emacs.

I have been using the "--daemon" mode together with the "zowex" binary for a while and it has been working great. But now after upgrading to the latest Zowe@next version (7.0.0-next.202202112312) I have problem using Emacs async functions start-process and async-shell-command the new zowe binary for using the daemon mode.

The problem is that I get no output from the command and process doesn't emit any events and just lives on doing (from Emacs point of view) nothing.

start-process is a Emacs function for starting an asynchronous process and is mainly used for running external programs without blocking Emacs.
Its synchronous counterpart call-process works perfactly fine, as does commands which uses the underlying shell for running the programs, such as shell-command.

I know this is bit of nitche problem but I would love if you could look into it. Tell me if there is anything you need.

Zowe --version = 7.0.0-next.202202112312
Windows 10 20H2
GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32)

I have not tested if the same problems occur on Linux, but I'm going to try and see this weekend.

Edit: When using the regular binary, AppData\Roaming\npm\zowe, it works as normal.

@t1m0thyj
Copy link
Member

What's the latest version of @zowe/cli@next that worked before you upgraded?
For reference, 7.0.0-next.202202092037 is the @next version that precedes 7.0.0-next.202202112312.
Or were you using an older version prior to upgrading?

I have been using the "--daemon" mode together with the "zowex" binary for a while and it has been working great.

I'm curious what version of the daemon binary you're using - we've renamed it from "zowex" to "zowe" and made several breaking changes to it since then. Newer versions of the daemon binary are available here, but I'd recommend running the command zowe daemon enable to make sure you get the right version for your CLI @next installation. This daemon enable command which we've recently added will extract the binary into the ~/.zowe/bin directory.

@Trisk3lion
Copy link
Author

Thanks for the answer @t1m0thyj!

As for your questions:

  1. I'm not sure what version I was running before i upgraded but I think I installed it somewhere around July-August because I think I used the 0.21 version of the Zowex binary.
  2. I followed the newer instructions when upgrading and used zowe daemon enable so that the binary I'm using.

For what is worth it seems to work just fine on Linux (tested on Ubuntu WSL2), which makes me suspect that it has something to do with #1309 and how the daemon process is handled on windows.

I will continue to experiment and see what I find out!

@Trisk3lion
Copy link
Author

I discovered another problem with the new Zowe Daemon and Emacs on Windows.

If you try to run zowe <any command> with the daemon binary before the daemon has started (the first time you run it), with call-process or shell-command you will hang Emacs indefinitely. The daemon seems to start but no output is sent to the sub process which Emacs creates. It is as if the output when starting the daemon is sent somewhere else.

But if you start the daemon beforehand, for example in cmd, it works just fine with call-process and shell-command (synchronous process commands).

@t1m0thyj
Copy link
Member

This may be related to #1277 - the way that child processes behave on Windows, a parent process cannot terminate until all its child processes have also terminated. Because of this we have a Windows-only step in our CI pipeline that starts the daemon background process before running tests. Otherwise we experience similar behavior to what you described, where a Jest test that runs zowe ... before the daemon has started will hang indefinitely.

@github-actions
Copy link

github-actions bot commented Nov 3, 2022

Thank you for creating a bug report. If you haven't already, please ensure you have provided steps to reproduce it and as much context as possible.

@t1m0thyj t1m0thyj added the priority-medium Not functioning - next quarter if capacity permits label Nov 3, 2022
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-medium Not functioning - next quarter if capacity permits
Projects
Status: Medium Priority
Development

No branches or pull requests

2 participants