My use case is similar to the example of worker_spi. A plpgsql function runs every 1 minute and processes records in audit tables in order to update fact tables with records that have changed. I noticed for example renaming a column in the function was not picked up, and I had to restart the workers to reset the cache.
relation_openrv and relation_openrv_extended call AcceptInvalidationMessages when the lockmode is not NoLock.
Don't we use those when doing SPI queries? No time to check right now, try setting some breakpoints or tracing through.