-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feature: merge std(err && out) logs and tidy logic of stdio #822
Conversation
The test can not go over
Error comes out from Weird, seems the test stuff is easy broke. |
Travis sometimes has issues with pm2 test suite. Let me fork this on my workspace and let you know. |
Sweet!!! appreciate!!! |
10.31 is ok Debian 7 |
@soyuka meantime, I've found a bug of |
…ld be removed." This reverts commit b94b659.
@soyuka I've reverted the previous commit and push a new one, you can read that one more thing I have done:
The problem is We should disconnect the previous CHILD_PROCESS, then spawn a new one, this actually makes a graceful reloadLogs |
Yes indeed, this is a nice improvement and would also prevent the famous "too many open files" unix error. @Unitech thoughts? |
Just dont merge this PR..bugs have been dug. :) |
No problem, let me know when you think it's good to go and I'll test it locally ;) |
I understand that the test suit is quite big and slow on all these Node.JS versions. I made a first POC to parallelize tests, but didn't went further (https://github.com/Unitech/PM2/blob/master/test/fast-test.sh#L48). By the way the refactor looks like a good initiative and improvement to me, thanks for helping to make this tool better 👍 |
feature: merge std(err && out) logs and tidy logic of stdio
I merged the PR into development, sometime tests are not passing, we should investigate more |
That's okay, @Unitech @soyuka @jshkurti I've deeply looked into the test bashes, and found that So, when you run
How to solve these?
|
I've restarted the failed 2 Travis Jobs, passed now. It seems have no relationship with this PR. x.x |
Tests pass better now! I refactored some stuff and also removed the Else your PR is nice, I haven't thought about making a third log file that would merge the error and output so we can inspect logs in contexts. I was thinking about doing something like pm2-logrotate that would be integrated into PM2, so we don't need to install and configure an external tool to get a production environment up and running. |
It is fine. I worked on node-forever for a while, and know exactly what him want, agreed with you, a merged log is needed sometime - to trace error context. And I've updated the Adv-ReadMe to let users known how to produce logs. Of course, if you guys have another brilliant idea to figure this out, it's glad to accept.= |
Final chapters:
child_process
graceful/peaceful, with some node vers, thechild_process
does not disconnect immediately even if it is dumped, maybe it is the GC strategy, so currently we should close the spawned process at once since the_reloadLogs
event is being triggered, it may fixes the following problems:EventEmitter.on
stdio
s are piping stream to a specific file at once (most of them are useless)Test cases of merge std(err && out) logs coverage