What if you’re not calculating π but doing something worth of a gen_server, like… say… communicating with a database and for whatever reason a particular operation is blocking you?
Or what if it’s not one single long blocking task, but instead the fact that you just have too many (really too many) messages in your gen_server’s queue and you can’t process them all before your supervisor times out?
Those scenarios are hard to predict but also likely to provoke a teardown that will get the server terminated via the supervisor. And in both scenarios, if your gen_server is not trapping exits, terminate/2
will not be evaluated.