RestComm / cloudhopper-smpp

Efficient, scalable, and flexible Java implementation of the Short Messaging Peer to Peer Protocol (SMPP)
Other
14 stars 22 forks source link

Threads get stuck at DefaultSmppClient.createConnectedChannel #21

Closed olenara closed 6 years ago

olenara commented 6 years ago

Aloha!

We have occasionally Threads stuck. All the thread dumps show the following:

"Sender Heartbeat 1" prio=10 tid=0x00007f0b50feb800 nid=0x7fa in Object.wait() [0x00007f0b849e2000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method)

Maybe it makes sense as a workaround not to wait forever in com.cloudhopper.smpp.impl.DefaultSmppClient#createConnectedChannel

    // attempt to connect to the remote system
    ChannelFuture connectFuture = this.clientBootstrap.connect(socketAddr);

    // wait until the connection is made successfully
// boolean timeout = !connectFuture.await(connectTimeoutMillis);
// BAD: using .await(timeout)
//      see http://netty.io/3.9/api/org/jboss/netty/channel/ChannelFuture.html
connectFuture.awaitUninterruptibly();
//assert connectFuture.isDone();

I am using version: 5.0.8

Cheers Ruwen

olenara commented 6 years ago

Closed by https://github.com/RestComm/cloudhopper-smpp/commit/6be5875f120fcc7855147dfbb69a9b21672a66af