Closed PedroAguiar closed 4 years ago
@PedroAguiar sorry for the late reply but this problem is fixed in version jbot-4.1.2-rc.1
can you please use this version and update this github issue?
Thank you @rampatra, it fixed the issue although I've had to put in place dummy configuration properties for the facebook side, even when the slack profile is the only one enabled.
Ah, I see. Maybe I can add a check and ignore the settings. Will keep this in mind for the next release.
Over long periods of inactivity, the slack bot fails through it's
Ping Task
execution due tojava.lang.IllegalStateException: The remote endpoint was in state [TEXT_PARTIAL_WRITING] which is an invalid state for called method
.We are using version
4.1.0
. Our use case only handles direct mentions and direct messages to query a database and respond with a really small and simple message. The DB payload is really small as well.Overnight usually when no one is talking to the bot the
Ping Task
is executed to keep theWebSocketSession
alive, during this ping - pong exercise the bot fails and does not recover from it. We have tried catching all exceptions thrown by thereply()
method, terminating the session by callingsession.close(CloseStatus.SERVICE_OVERLOAD)
and restarting it by callingstartRTMAndWebSocketConnection()
We have also made all
reply()
calls thread-safe by wrapping ourWebSocketSession
inside aConcurrentWebSocketSessionDecorator
and encapsulating allreply()
calls to the following method:Despite our efforts to make this reply call thread-safe and able to handle concurrency the issue seems to reside inside the
PingTask
. Note: Our slack-bot resides inside an ECS task with the desired count set to 1 and no autoscaling in place. All methods call thedoReply()
method above and do not create new threads to do so.