ESP32 sometimes don‘t react to irq

Hello all,

I got some strange behavior with my ESP32. Sometimes it feels like the controller fall asleep for a short time and reacts to a interrupt with a high time delay of around a second.

Background: I use a decoder to change the info on a LCD. Id the encoder counts one step an interrupt is raised and a callback function will change the LCD info.
There are some for-loops with a 10ms sleep. But I think the Interrupt will also be recognized if the controller is in a sleep state.
The time to transmit the info to the LCD is high of course and I know that the communication via I2C is slow. But if I add all the times to a sum I would expect a REACTION time of less than 100ms. And in most cases this is what happens. But sometimes I turn the decoder one step and put my hands away and then after a second the reaction happens. Have no idea what happens or what could delay the interrupt callback that way.
Do you have any ideas?

Check the pinned post on how to use the forum. CLUE, post ALL the code in code tags, post any error logs in code tags, post a wiring diagram (photo of hand drawn is fine)
Without seeing your code, I bet you have code inside the ISR. Simple solution is don't use delay, only set flag in ISR and do the processing in a millis controlled section.

Are you using an Arduino Nano ESP32 or some other ESP32?

Based on the code and schematic you posted, I’d take a SWAG (Scientific Wild-Assuming Guess) and suggest that you might be spending too much time in your ISR (Interrupt Service Routine).