Pi4J / pi4j-v1

DEPRECATED Java I/O library for Raspberry Pi (GPIO, I2C, SPI, UART)
http://www.pi4j.com
Apache License 2.0
1.31k stars 448 forks source link

"GpioInterrupt.handleEvents(): Interrupted while waiting for new events!" in Pi4J v1.4 #516

Closed savageautomate closed 3 years ago

savageautomate commented 3 years ago

I'm getting "GpioInterrupt.handleEvents(): Interrupted while waiting for new events!" printed to the console during a normal Pi4J shutdown in Pi4J v1.4.

REF: https://github.com/Pi4J/pi4j/blob/develop/1.4/pi4j-core/src/main/java/com/pi4j/wiringpi/GpioInterrupt.java#L211-L229

Testing using GpioOutputAllExample.java from a Raspberry Pi 4B running 64-bit Raspbian.

pi4j GpioOutputAllExample.java

Entered "q" to quit at the program prompt and got the following output:

************************************************************
                           GOODBYE                          
************************************************************

GpioInterrupt.handleEvents(): Interrupted while waiting for new events!

I think we need to suppress this message either entirely or at least when there is a graceful shutdown/exit.

eitch commented 3 years ago

ahh, yes. This is of course wrong of me to use an error logger. This is just normal shut down behaviour. Should have just checked if the run flag is false and then end the method, or otherwise continue waiting for events.

savageautomate commented 3 years ago

Confirmed fix.