By default, killall(1) sends a software termination signal (SIGTERM or -15) to the named application. If the application is well written, it will capture that signal, take the proper steps to perform internal house-keeping, and then quit gracefully. If there is network activity ongoing when it receives SIGTERM, it may take some time to close those down. I suggest that you follow your default killall command with:
sleep 15
which will suspend processing after the killall command by 15 seconds before it moves on to the next action. On other platforms the sleep command will take s, m, h, and other modifiers after the value for different time measures, but not on macOS.
Spark might also intercept and ignore a SIGTERM. In that case, you would have to specify stronger medicine (SIGKILL or -9) which could cause it to quit ungracefully (abruptly) with potential mail corruption.
In either case,