Skip to content

[1.21.4] Map/image data corrupts randomly after clean /stop — onEnable/onDisable doesn't wait for pending async save writes #174

Description

@eason2141

On restart, a random image map occasionally comes back corrupted. A subsequent restart usually fixes that specific map, but at some later point a different map corrupts instead. This happens even when the server is stopped cleanly (no crashes, no force-kills).

Environment

  • ImageFrame version: 1.8.5.0
  • Server software: PaperMC
  • Minecraft version: 1.21.4

Looking at the server log during shutdown, ImageFrame's disable sequence returns instantly with no indication it waited for any in-progress I/O:

[ImageFrame] Disabling ImageFrame v1.8.5.0
[ImageFrame] ImageFrame has been Disabled!

Both lines are logged in the same second. By contrast, other plugins that do async saves (e.g. QuickShop-Hikari) explicitly block and log progress while flushing pending writes before completing their disable sequence:

[QuickShop-Hikari] QuickShop is finishing remaining work, this may need a while...
[QuickShop-Hikari] Saving all in-memory changed shops...
[QuickShop-Hikari] Saving shops, please allow up to 30 seconds for flush changes into database...
...
[QuickShop-Hikari/Bootstrap] QuickShop-Hikari - Bootstrap -> All Complete (6ms)
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions