meadvillerb/onstomp — comment on commit a88ccb0411db22641fe1caf137df916eb1733ce5
File: lib/onstomp/connections/base.rb line 231
By iande:

This is the real source of our problem. `on_connection_(closed|terminated|died)` handlers can make major changes to the actual connection. Our IO processor is blindly grabbing the client's `connection` attribute without verifying it's the same connection it was supposed to be handling, and all kinds of nasty race conditions break loose when we ultimately come back to `raise`.