Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Not connected to server" when trying to send a message #383

Open
ForNeVeR opened this issue Apr 22, 2016 · 2 comments
Open

"Not connected to server" when trying to send a message #383

ForNeVeR opened this issue Apr 22, 2016 · 2 comments
Labels

Comments

@ForNeVeR
Copy link
Member

Horta somehow reconnected after receiving the message (that means it was indeed connected to server).

03:16:26.579 [CodingteamSystem-akka.actor.default-dispatcher-20486] DEBUG s.StatementExecutor$$anon$1 - [SQL Execution] insert into Log (time, room, sender, type, message) values ('2016-04-22 03:16:26.579', '[email protected]', 'ForNeVeR', 'message', 'send/gsomix/Есть же Aether:/'); (0 ms)
03:16:26.580 [CodingteamSystem-akka.actor.default-dispatcher-20483] ERROR akka.actor.OneForOneStrategy - Not connected to server.
java.lang.IllegalStateException: Not connected to server.
        at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:445) ~[horta-hell.jar:0.15.2]
        at org.jivesoftware.smack.ChatManager.sendMessage(ChatManager.java:259) ~[horta-hell.jar:0.15.2]
        at org.jivesoftware.smack.Chat.sendMessage(Chat.java:97) ~[horta-hell.jar:0.15.2]
        at ru.org.codingteam.horta.protocol.jabber.JabberProtocol$$anonfun$receive$1$$anonfun$applyOrElse$5.apply(JabberProtocol.scala:118) ~[horta-hell.jar:0.15.2]
        at ru.org.codingteam.horta.protocol.jabber.JabberProtocol$$anonfun$receive$1$$anonfun$applyOrElse$5.apply(JabberProtocol.scala:118) ~[horta-hell.jar:0.15.2]
        at ru.org.codingteam.horta.protocol.jabber.JabberProtocol.ru$org$codingteam$horta$protocol$jabber$JabberProtocol$$sendMessage(JabberProtocol.scala:188) ~[horta-hell.jar:0.15.2]
        at ru.org.codingteam.horta.protocol.jabber.JabberProtocol$$anonfun$receive$1.applyOrElse(JabberProtocol.scala:118) ~[horta-hell.jar:0.15.2]
        at akka.actor.Actor$class.aroundReceive(Actor.scala:465) ~[horta-hell.jar:0.15.2]
        at ru.org.codingteam.horta.protocol.jabber.JabberProtocol.aroundReceive(JabberProtocol.scala:19) ~[horta-hell.jar:0.15.2]
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) [horta-hell.jar:0.15.2]
        at akka.actor.ActorCell.invoke(ActorCell.scala:487) [horta-hell.jar:0.15.2]
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) [horta-hell.jar:0.15.2]
        at akka.dispatch.Mailbox.run(Mailbox.scala:220) [horta-hell.jar:0.15.2]
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) [horta-hell.jar:0.15.2]
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [horta-hell.jar:0.15.2]
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [horta-hell.jar:0.15.2]
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [horta-hell.jar:0.15.2]
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [horta-hell.jar:0.15.2]
03:16:26.581 [CodingteamSystem-akka.actor.default-dispatcher-20486] INFO  r.o.c.h.p.jabber.JabberProtocol - Disconnecting
03:16:26.737 [CodingteamSystem-akka.actor.default-dispatcher-20487] INFO  r.o.c.h.p.jabber.JabberProtocol - Disconnected

Maybe we're still leaking these connections / listeners somehow?

@ForNeVeR
Copy link
Member Author

ForNeVeR commented Jul 3, 2016

It seems that Horta sometimes may lose the message due to the connection problem. Here's the scenario:

  1. Horta receives send command.
  2. Horta thinks that the target user is in the room, so it tries to send the message to him.
  3. At this moment server suddenly reports Horta that it's disconnected.
  4. The message is lost (FAIL). It should be saved to the database instead. After that the disconnect should proceed as usual (e.g. rethrow an exception).

@ForNeVeR ForNeVeR changed the title "Not connected to server" "Not connected to server" when trying to send a message Jul 3, 2016
@ForNeVeR
Copy link
Member Author

And another source of errors:

  1. Horta connects the room.
  2. Connection gets broken for some reason; it's even catched and properly logged.
  3. Connection is not closed; it's not recreated or something. The next message send will fail, kill the whole actor, and that's it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant