Open
Description
SerialPort Version
12.0.0
Node Version
v18.18.2
Electron Version
No response
Platform
Linux devfox 6.8.2-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 28 Mar 2024 17:06:35 +0000 x86_64 GNU/Linux
Architecture
x64
Hardware or chipset of serialport
Prolific Technology, Inc. PL2303 Serial Port / Mobile Phone Data Cable
What steps will reproduce the bug?
- Attach a USB-to-serial adapter to the computer and leave the serial port side disconnected so no data is available to read.
- Create a
SerialPort
instance and attach adata
callback:serialport.on('data', (data) => { ... })
. - Wait a few seconds, then close the
SerialPort
instance:serialport.close(...)
. (Addingpause()
ordestroy()
produces the same result)
Minimal repro: serialport-test.ts
What happens?
Even after calling close()
or destroy()
, the promise created on unix-read.ts:41 never resolves / rejects. As a result, Node.js is prevented from exiting indefinitely.
See sample output from the minimal repro program above.
What should have happened?
The program should be able to exit cleanly after close()
/ destroy()
is called.
Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels