When I want to fast user switch from user A to user B, a login window appears where I enter user B's password. When I'm done, a rotating progress indicator spins for a couple seconds, until user B gets logged in.
However, sometimes (as in precisely now), user B is not logged in. The login window is still up and its rotating indicator is still rotating. It has been stuck like that for several minutes. Behind it, darkened but still visible, are all user A's windows with their (unsaved) data.
For example: iTunes is still playing, but I can't do anything: the login window cannot be dismissed, and the attempted, and apparently still going on, user login cannot be cancelled.
Command-option escaped to bring up the force quit window doesn't do anything.
Trying to share the Mac's screen from another or trying to control it from Remote Desktop doesn't work as the Mac doesn't respond.
However, I can still remote connect with the terminal using SSH. So I still have some hope to recover from the terminal, perhaps by killing the stuck login process.
How can I find out which process to quit? Is there anything else I can try, short of forcing a shutdown of the stuck Mac?
My Mac is running Mac OS X 10.9.2. (No external disk that might be stuck mounting or unmounting.)