EssentialsX

EssentialsX

2M Downloads

Async Backup function preventing shutdown

ice-fly opened this issue ยท 5 comments

commented

Information

Full output of /ess version:

[01:11:55 INFO]: This server is running Essentials 2.17.2.0

Server log: ... (see paper issue below)

EssentialsX config: Relevant part:

backup:
  interval: 162
  command: 'backup.bat'

Details

Description
When performing backup and server is shut down, async task prevents shutdown.
See: PaperMC/Paper#3337
Jroy & Aikar had discussion in paper discord... "future.join"

Steps to reproduce
Set backup script in config.yml to do a slow backup... (use timeout or IPG),
Call /backup, call /restart or /stop

Solution according to aikar

create a future on task start and store it in plugin class
in onDisable, if future is set, log "Backup task in process, waiting for it to finish"
then do future.join()

A band-aid solution could be to allow backup script to continue running even when essentials has shutdown.

commented

will work on a fix

commented

Might be useful to squash two bugs with one update
Willing to help on writing the docs on backups for the windows section... The old essentials wiki doesn't even have windows 10 listed and in my opinion should be updated to recommend power-shell. I am running my server on windows 10 and am fairly good at both batch & power-shell. I use power-shell scripts because they allow for async & more complicated handling.

commented

@ice-fly Feel free to contribute a new wiki page - you can open PRs to the wiki here.

commented

In the latest build, EssentialsX now informs you that a backup task is running if you /stop while a backup is in progress. You can download the latest version from the EssentialsX website.

commented

Thanks gents!