Connection recovery can send multiple bind requests

Post Reply
shane
Posts: 5
Joined: Tue Apr 28, 2020 6:43 am

Connection recovery can send multiple bind requests

Post by shane » Tue May 12, 2020 6:37 am

Hi,

After a client is disconnected from a server, it attempts to reconnect and rebind.

If the server is in a bad state, where it accepts the connection but does not respond to messages, these binding attempts with fail with SMPPCLIENT_RCVTIMEOUT and the socket will be disconnected. The client will then try again. When the server recovers and the client automatically reconnects, the client will erroneously send multiple bind requests, presumably attempting to resend all of the bind requests which previously failed to be responded to when the server was in a bad state.

You can reproduce the server in a bad state by pausing for debugging on the server.

On another related occasion (which I can't reproduce), I also received lots of logs about duplicate sequence numbers being used.

Interesting parts of logs:

Code: Select all

Client when server becomes unresponsive:

12.05.2020 16:21:22:WARN : 63: (SmppClient3) EnquireLink failed. Response Status SMPPCLIENT_RCVTIMEOUT. Sequence 4. InterNetwork/localhost:7799 SystemId: 2-tx
Disconnected event raised.
12.05.2020 16:23:03:WARN : 94: (SmppClient3) Bind failed. Status SMPPCLIENT_RCVTIMEOUT. Repeat in 1 seconds.
Disconnected event raised.
...etc

Server after it recovers: (in this case, restarted)

Client 127.0.0.1:61349 bound as 2-tx
Client 127.0.0.1:61349 bound as 2-tx
Client 127.0.0.1:61349 bound as 2-tx

Client after connection is recovered:

12.05.2020 16:24:35:WARN :138: (SmppClient3) Cannot find request for response BindTransceiverResp, Status: ESME_ROK, Sequence: 10, SystemId: Inetlab.SMPP. Response was received after ResponseTimeout or with wrong sequence_number.
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Connection recovery can send multiple bind requests

Post by alt » Wed May 13, 2020 12:57 pm

Hi shane,

I think it was an error in starting reconnect task from disconnect event. SmppClient has started new reconnect task every time when it disconnects. The previous reconnect task waits for connection and when client connects all tasks sends bind request.
I'm going to fix this bug in the version 2.8.1
shane
Posts: 5
Joined: Tue Apr 28, 2020 6:43 am

Re: Connection recovery can send multiple bind requests

Post by shane » Thu May 14, 2020 1:26 am

Sounds good!
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Connection recovery can send multiple bind requests

Post by alt » Thu May 14, 2020 2:08 pm

Please test with version 2.8.1-beta-2021.
TradeLabelSoftware
Posts: 1
Joined: Thu Jan 12, 2023 4:16 am
Location: Delhi, India
Contact:

Re: Connection recovery can send multiple bind requests

Post by TradeLabelSoftware » Wed Jan 18, 2023 9:20 am

when are you launching the full version 2.8.1 ?
DRPU Trade Label Software by https://www.tradelabelsoftware.com
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Connection recovery can send multiple bind requests

Post by alt » Wed Jan 18, 2023 4:50 pm

It is already released. See the change log.
Arshi
Posts: 1
Joined: Thu Feb 02, 2023 6:38 am

Re: Connection recovery can send multiple bind requests

Post by Arshi » Sun Feb 05, 2023 3:10 pm

There is multiple version available on the changelog page which one should i use?GBWhatsApp
Post Reply