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

Fix trigger API never calling callback #2770

Merged
merged 1 commit into from
Mar 15, 2017
Merged

Fix trigger API never calling callback #2770

merged 1 commit into from
Mar 15, 2017

Conversation

yaroslav-korotaev
Copy link

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR https://github.com/pm2-hive/pm2-hive.github.io/pulls

When using PM2 as API, sometimes it doesn't call the callback passed to trigger() function. I've found that it happens when msgProcess()'s callback is called before the bus event is received (process_wait_count still be a zero). So, we wait for bus launch, register listener on it, and then send a message to process.

@vmarchaud
Copy link
Contributor

Good catch, i'll merge when the tests pass.

@yaroslav-korotaev
Copy link
Author

I've repeated local test launch with something like this:

cd ~/dev/pm2
bin/pm2 kill
cd ~/dev
rm -rf pm2
rm -rf ~/.pm2
rm -rf ~/.pm2-dev
git clone git@github.com:yaroslav-korotaev/pm2.git
cd pm2
git checkout development
npm install
npm test

And it's pass.
Ubuntu 16.04, Node 6.10.0, nvm and php installed.

@vmarchaud vmarchaud merged commit 38d8228 into Unitech:development Mar 15, 2017
inerc pushed a commit to inerc/pm2 that referenced this pull request Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants