When we do a restore in JIRA we try to stop any long running tasks. Currently there us no way for JIRA to wait for Crowd synchronizations to finish. This can lead to JIRA failing during the restore with random reasons. For example, we can get Unique Index Errors from the DB because the Crowd Sync is trying to write data at the same time JIRA is restoring data.
We need an API that allows us to both wait for any currently running synchronizations to stop and to stop any other syncrhoizations from starting (e.g. shutdownAndWait). For extra points, it would be nice if it was possible to interrupt/stop the sync before it is finished.