問題文
Tasks that a pool runs sometimes raise a RuntimeException, and nothing about those failures shows up in the log. The tasks were handed over with submit. What explains the silence?
選択肢
- The failure is kept inside the Future that submit returned, so nothing is reported until the code calls get on that Future
- The pool discards a failure from a task on purpose, because a pool has to stay usable and therefore drops anything that a single task raised
- The execute method keeps failures inside a Future as well, so both ways of handing work over end in the same silence
- The exception reaches the thread that submitted the task, which swallows it because it has moved on