Hi,
I am facing a weird issue with XMPP4r i.e. it gets stuck with a specific code. I am able to recreate the problem with the following snippet which loops through all the users in the system and tries to connect to the XMPP server:
def connect_users_to_chat
User.all.each do | user |
begin
chat_username = user.try(:chat_username)
client = Jabber::Client.new(Jabber::JID::new("#{chat_username}@localhost"))
client.allow_tls = false
client.connect
puts "#{chat_username} connected"
client.auth('password')
puts "#{chat_username} authorised"
client.close
rescue Exception => ex
puts "Exception while connecting for #{chat_username} with id #{user.id} with msg #{ex.message}"
end
end
end
I ran it against 10-12 users and the code gets stuck while calling auth method. Its purely random i.e. am not able to reproduce it for a specific user or specific position.
When I did a strace on the process, it showed the status as FUTEX_WAIT_PRIVATE.
Any clue on whats wrong and how to tackle it?
Thanks,
Leena