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

pm2 trigger command hangs #3786

Closed
pankleks opened this issue Jul 12, 2018 · 6 comments
Closed

pm2 trigger command hangs #3786

pankleks opened this issue Jul 12, 2018 · 6 comments

Comments

@pankleks
Copy link

I sending custom command to pm2 process with pm2 trigger myapp test

After issuing command pm2 answers:

[myapp:4]="my answer"
1 processes have received command test

Then it hangs.

This does not happen everytime, in most cases it works - but I can't find any pattern.

System: Ubuntu 16.04, 18.04
PM2: 2.6, 3.0.0

In my app I respond according to doc:

        Pmx.action("test", (reply) => {
            reply(`my answer`);
        });
@Unitech
Copy link
Owner

Unitech commented Jul 12, 2018

Are you using https://www.npmjs.com/package/pmx or https://www.npmjs.com/package/@pm2/io?
Which pmx version?

Thanks

@pankleks
Copy link
Author

Thanks for reply. I'm using Pmx

@pankleks
Copy link
Author

Not sure how to check pmx version, I'm adding package pm2 in version 2.10.4

@Unitech
Copy link
Owner

Unitech commented Jul 13, 2018

action.js:

var pmx = require('pmx')

pmx.action("test", (reply) => {
  reply(`my answer`);
});
$ pm2 start action.js 
$ pm2 trigger action test
c1 processes have received command test
[action:0]="my answer"

PMX version 1.6.7, PM2 3.0

I did the command 20 times it worked every time.

How did you started your application?

@pankleks
Copy link
Author

it's installed as pm2 module with pm2 install my-app

@wallet77
Copy link
Contributor

wallet77 commented Aug 20, 2018

It seems we have this behavior if (and only if) the called action doesn't exist.
I will try to fix it but it seems to not be your issue because your action is received by application.

wallet77 added a commit that referenced this issue Aug 21, 2018
wallet77 added a commit that referenced this issue Aug 21, 2018
fix: #3786 fix issue when triggering an action that does not exist
@Unitech Unitech closed this as completed in 1ff7fd3 Sep 7, 2018
inerc pushed a commit to inerc/pm2 that referenced this issue Feb 11, 2020
inerc pushed a commit to inerc/pm2 that referenced this issue Feb 11, 2020
inerc pushed a commit to inerc/pm2 that referenced this issue Feb 11, 2020
fix: Unitech#3786 fix issue when triggering an action that does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants