Yes, this has happened enough to my wife, friends, and I that we have our own terms and phrases. One of my friends calls them dementors (after Harry Potter). I stole that term from him.
Engaging one in conversation is "petting the stray." I'll say hi to someone and politely ask how they're doing. (They're not supposed to actually tell you, right?!) A long, painful, one-sided conversation later, my wife says, "Well, you just pet the stray." Sometimes my wife or friend will recognize "that unstable look" and tell me, "Don't pet that stray." - and I'll do what I can to avoid a conversation.
When it's an acquaintance, I avoid the person or engage them when it's apparent that I don't have a lot of time to talk, or avoid asking about certain topics. Sometimes I work with the person and it's unavoidable. I work with engineers and some of them, when you ask them what time it is, they tell you how to build a watch.