Open fr-nevin opened 5 years ago
Can you include a script that is triggering this behavior?
@mcollina Hmm, it's a big script at the moment. I might need to make something small and run it. Let me give it a try and see if I can reproduce it.
@mcollina I just put a simple code like this -
const testFunction = () => {
console.log('testFunction running.....')
}
setInterval(() => {
testFunction();
}, 1000);
Then press Ctrl+C
, it stops at ..
^C[ ] Received Ctrl+C, closing process...
Doesn't work on MAC.
@mcollina But if there's a javascript file, which doesn't require stopping.. it would run it's course and shows the html metrics. 👍
Does it only happen with the --on-port
flag or also if you omit it?
@goto-bus-stop
clinic doctor 'autocannon http://localhost:$PORT' -- node tools/testFunction.js - Ctrl + C not working.
clinic doctor '--autocannon http://localhost:$PORT' -- node tools/testFunction.js - Ctrl + C not working.
clinic doctor --autocannon -- node tools/testFunction.js - Ctrl + C not working.
clinic doctor --wrk -- node tools/testFunction.js - Ctrl + C not working.
All end up with the result:
^C[ ] Received Ctrl+C, closing process...
And ends the process.
I think problem lies with the handling of the Ctrl+C
on MAC. Because, as I said earlier, without Ctrl + C, if it was a small script without a continuous polling, it would show up with the results.
@mcollina @goto-bus-stop Checked against 4 OS's in total (2 MAC and 2 Linux. ) Worked on both the linux, but not the MAC.
@fr-nevin - Does this issue happen with v5 of Clinic?
npm install -g clinic@5
This is working on Mac for me.
dylanc@dc_mbp Clinic % clinic doctor --on-port 'autocannon http://localhost:$PORT' -- node node-clinic-doctor-examples/slow-io Running 10s test @ http://localhost:3000/ 10 connections
Caught SIGINT, shutting down. [ ] Received Ctrl+C, closing process...Caught SIGINT, shutting down.
Let us know if you have any issues with current versions of Clinic.
Dup of #152
Hi, I am still having this issue on Mac.
Clinic.js version: "6.0.3", Node.js version: 12.16.1, npm - 6.13.4 Browser name and version: NA Operating system and version: OS X 10.15.6
Thanks for awesome tool!
Hi, I am having this issue on Windows
Clinic.js version: "7.0.1", Node.js version: 14.15.3, npm - 6.14.9
I'm also having this issue. Mac OS X 11.5.2 Big Sur Node v14.15.1 Clinic v9.0.0
Any work arounds
I have the same issue, but if after Ctrl+C (which loops indefinitely I press Enter). The results is:
^C[ ] Received Ctrl+C, closing process...
[ =] Received Ctrl+C, closing process...
events.js:377
throw er; // Unhandled 'error' event
^
Error: read EIO
at TTY.onStreamRead (internal/stream_base_commons.js:209:20)
Emitted 'error' event on ReadStream instance at:
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -5,
code: 'EIO',
syscall: 'read'
}
My setup is: MacOS Big Sur 11.6 Node: v14.17.6 clinic@^9.0.0
@DylanC if there is some workaround for this, could you please share here?
@DmytroSokhach - I'm not very involved in this project at the moment and I don't currently have access to a Mac. Reopened the issue for now.
Look for the SIGINT( catches ctrl+c event) event handlers in your code or the dependencies.
if you have one, exit
the process in the handling. This worked for me(OsX Catalina
/ clinic@9.0.0)
process.on('SIGINT', function() {
// do your handling
// exit the process
process.exit();
});
I'm having this issue only for flame
. doctor
and bubbleprof
work just fine
Same Issue on generating the reports upon clicking on "ctrl + c" on Linux:
Expected Behavior
Bug: 'Ctrl+C' stops the doctor, and doesn't even reach to the analyzing part.
Current Behavior
I am trying to run clinic against a script, which needs to be run on background calling a polling function to check if there was an event triggered from the front end. Once the event has been sent from the front end, this polling function takes care of the event. Once it's done. I stop by using
Ctrl + C
, where theAnalyzing
bar doesn't appear.Environment
Clinic.js version: "4.0.3",
Node.js version: 10.15.3, npm - 6.4.1
Browser name and version: Chrome Version 73.0.3683.103
Operating system and version: Your OS is OS X 10.14.1 [Mac OS Mojave]
Additional Info
The same command am using:
clinic doctor --on-port 'autocannon http://localhost:$PORT' -- node tasks/cathy.js
works for 2 of my friends Linux PC, but not on my MAC. (Going to confirm with another MAC friend soon. Will update it here.)