when setKeepSpawnInMemory is set to false on a world it causes server shutdown to hang on saving worlds. Eventually this hang causes spigot to stop responding.
In order to reproduce this bug you must:
1: install the attached plugin on your server. (it's a minimal reproducer jar).
2: log in and alter the world. (break some blocks)
3: shutdown the server. (/stop command)
provided attachments are the log and a minimal reproducer plugin jar.
I spent 1 hour ensuring that to the best of my ability this indeed appears to be a bug.
This was not an issue in 1.18.1 from what i can tell.