I am afraid you can't be guaranteed that futures will not die. But that will depend…
First, it will depend on the ExecutionContext you are using. If the ExecutionContext is backed by a daemon thread, Futures can “die” when the application terminates. If the ExecutionContext is backed by a non-daemon thread, Futures should not die this way on a normal exit. (Note that using non-daemon threads for ExecutionContext complicates VM shutdown somehow: they have to be shut down manually, maybe when some signal is received.) However…
Second, it depends what types of exit you consider. When you consider power outage, OutOfMemoryError, JVM crash, kernel panic, Linux OOM kill, kill -9 and so on, Futures can't survive that. Depending on your business requirements, you may need to consider using some durable message queue or something like that. You put the task to the queue and wait until it is confirmed to be stored to some durable storage. (You can use SQL DB – while this is probably not the most efficient solution, it should work…) After you have saved the message into the queue, you will send the Ok to the client. Then, there will be some other process (maybe on a different machine) that will consume the tasks.
But suitability of such solution may depend on the type of tasks. Imagine there is a power outage (or some other kind of interuption) after the task is processed, but before the task is deleted from the queue. If the tasks are idempotent (e.g. statistics recalculation), it is clearly OK to repeat them. If the task sends an e-mail, this is not so good, but sending double e-mail is some rare cases can be a negligible issue. In some cases, the task can be of a truly transactional nature and you will have to care about that, because doing such task twice has unwanted consequences. But… but this is far beyond the original question.
Regards,
Vít Šesták 'v6ak'