Hi, thank you for your replies. Below the results of my test.
We have 6 connections with the same user, using 6 different Resources.
As you can see in the logs below, each connection incurs a 5 seconds timeout, the Xmpp server does not include the closing stream tag and we do not see the error log “Exception while waiting for closing stream element from the server”.
2021-09-28T15:55:36,707GMT INFO v6.2.1-SNAPSHOT [Thread-33](XMPPConnectionListener.java:25) com.xmpp.smack.XMPPConnectionListener: [ClientId: client-1] Connection closed
2021-09-28T15:55:41,708GMT INFO v6.2.1-SNAPSHOT [Thread-33](XMPPConnectionListener.java:25) com.xmpp.smack.XMPPConnectionListener: [ClientId: client-2] Connection closed
2021-09-28T15:55:46,710GMT INFO v6.2.1-SNAPSHOT [Thread-33](XMPPConnectionListener.java:25) com.xmpp.smack.XMPPConnectionListener: [ClientId: client-3] Connection closed
2021-09-28T15:55:51,712GMT INFO v6.2.1-SNAPSHOT [Thread-33](XMPPConnectionListener.java:25) com.xmpp.smack.XMPPConnectionListener: [ClientId: client-4] Connection closed
2021-09-28T15:55:56,714GMT INFO v6.2.1-SNAPSHOT [Thread-33](XMPPConnectionListener.java:25) com.xmpp.smack.XMPPConnectionListener: [ClientId: client-5] Connection closed
2021-09-28T15:56:01,715GMT INFO v6.2.1-SNAPSHOT [Thread-33](XMPPConnectionListener.java:25) com.xmpp.smack.XMPPConnectionListener: [ClientId: client-6] Connection closed
Here is the Xmpp traffic during the shutdown phase (with my comments):
# First connection sends shutdown and closes the stream
T 172.31.87.65:40214 -> 52.212.55.84:5222 [AP] #289
<presence from='user@xmpp.example.com/client-1' id='QCD1M-2' type='unavailable'/><a xmlns='urn:xmpp:sm:3' h='31'/></stream:stream>
#####
# Xmpp server sends disconnection event to other resources of the same user.
# Smack connections have these source ports:
40214
40216
40218
40220
40222
40224
All active clients receive the logout event (see below) with the 5 seconds timeout, as reported by XMPPConnectionListener.
T 52.212.55.84:5222 -> 172.31.87.65:40222 [AP] #294
<presence xmlns="jabber:client" from="user@xmpp.example.com/client-1" to="user@xmpp.example.com/client-5" type="unavailable"/>
##
T 52.212.55.84:5222 -> 172.31.87.65:40224 [AP] #296
<presence type="unavailable" xmlns="jabber:client" from="user@xmpp.example.com/client-1" id="QCD1M-1"><priority>0</priority><c hash="sha-1" ver="NfJ3flI83zSdUDzCEICtbypursw=" xmlns="http://jabber.org/protocol/caps" node="https://igniterealtime.org/projects/smack"/></presence>
#
T 52.212.55.84:5222 -> 172.31.87.65:40218 [AP] #297
<presence type="unavailable" xmlns="jabber:client" from="user@xmpp.example.com/client-1" id="QCD1M-1"><priority>0</priority><c hash="sha-1" ver="NfJ3flI83zSdUDzCEICtbypursw=" xmlns="http://jabber.org/protocol/caps" node="https://igniterealtime.org/projects/smack"/></presence>
###
T 52.212.55.84:5222 -> 172.31.87.65:40220 [AP] #300
<presence type="unavailable" xmlns="jabber:client" from="user@xmpp.example.com/client-1" id="QCD1M-1"><priority>0</priority><c hash="sha-1" ver="NfJ3flI83zSdUDzCEICtbypursw=" xmlns="http://jabber.org/protocol/caps" node="https://igniterealtime.org/projects/smack"/></presence>
##
T 52.212.55.84:5222 -> 172.31.87.65:40216 [AP] #302
<presence type="unavailable" xmlns="jabber:client" from="user@xmpp.example.com/client-1" id="QCD1M-1"><priority>0</priority><c hash="sha-1" ver="NfJ3flI83zSdUDzCEICtbypursw=" xmlns="http://jabber.org/protocol/caps" node="https://igniterealtime.org/projects/smack"/></presence>
#
#
T 172.31.87.65:40216 -> 52.212.55.84:5222 [AP] #304
<presence from='user@xmpp.example.com/client-2' id='17PJH-2' type='unavailable'/><a xmlns='urn:xmpp:sm:3' h='31'/></stream:stream>
#####
T 52.212.55.84:5222 -> 172.31.87.65:40218 [AP] #309
<presence type="unavailable" from="user@xmpp.example.com/client-2" xmlns="jabber:client" to="user@xmpp.example.com/client-3"/>
##
T 52.212.55.84:5222 -> 172.31.87.65:40220 [AP] #311
<presence type="unavailable" from="user@xmpp.example.com/client-2" xmlns="jabber:client" to="user@xmpp.example.com/client-4"/>
##
T 52.212.55.84:5222 -> 172.31.87.65:40224 [AP] #313
<presence type="unavailable" from="user@xmpp.example.com/client-2" xmlns="jabber:client" to="user@xmpp.example.com/client-6"/>
##
T 52.212.55.84:5222 -> 172.31.87.65:40222 [AP] #315
<presence xmlns="jabber:client" from="user@xmpp.example.com/client-2" type="unavailable" id="17PJH-1"><priority>0</priority><c hash="sha-1" ver="NfJ3flI83zSdUDzCEICtbypursw=" xmlns="http://jabber.org/protocol/caps" node="https://igniterealtime.org/projects/smack"/></presence>
#
#
T 172.31.87.65:40218 -> 52.212.55.84:5222 [AP] #317
<presence from='user@xmpp.example.com/client-3' id='LTZYC-2' type='unavailable'/><a xmlns='urn:xmpp:sm:3' h='32'/></stream:stream>
####
T 52.212.55.84:5222 -> 172.31.87.65:40220 [AP] #321
<presence type="unavailable" from="user@xmpp.example.com/client-3" xmlns="jabber:client" to="user@xmpp.example.com/client-4"/>
##
T 52.212.55.84:5222 -> 172.31.87.65:40224 [AP] #323
<presence type="unavailable" from="user@xmpp.example.com/client-3" xmlns="jabber:client" to="user@xmpp.example.com/client-6"/>
###
T 52.212.55.84:5222 -> 172.31.87.65:40222 [AP] #326
<presence xmlns="jabber:client" from="user@xmpp.example.com/client-3" type="unavailable" id="LTZYC-1"><priority>0</priority><c hash="sha-1" ver="NfJ3flI83zSdUDzCEICtbypursw=" xmlns="http://jabber.org/protocol/caps" node="https://igniterealtime.org/projects/smack"/></presence>
##
T 172.31.87.65:40220 -> 52.212.55.84:5222 [AP] #328
<presence from='user@xmpp.example.com/client-4' id='UWUH8-2' type='unavailable'/>
##
T 172.31.87.65:40220 -> 52.212.55.84:5222 [AP] #330
<a xmlns='urn:xmpp:sm:3' h='33'/></stream:stream>
#
T 52.212.55.84:5222 -> 172.31.87.65:40224 [AP] #331
<presence type="unavailable" from="user@xmpp.example.com/client-4" xmlns="jabber:client" to="user@xmpp.example.com/client-6"/>
#####
T 52.212.55.84:5222 -> 172.31.87.65:40222 [AP] #336
<presence xmlns="jabber:client" from="user@xmpp.example.com/client-4" type="unavailable" id="UWUH8-2"/>
###
T 172.31.87.65:40222 -> 52.212.55.84:5222 [AP] #339
<presence from='user@xmpp.example.com/client-5' id='CP7RJ-2' type='unavailable'/><a xmlns='urn:xmpp:sm:3' h='34'/></stream:stream>
#####
T 52.212.55.84:5222 -> 172.31.87.65:40224 [AP] #344
<presence type="unavailable" xmlns="jabber:client" from="user@xmpp.example.com/client-5" id="CP7RJ-1"><priority>0</priority><c hash="sha-1" ver="NfJ3flI83zSdUDzCEICtbypursw=" xmlns="http://jabber.org/protocol/caps" node="https://igniterealtime.org/projects/smack"/></presence>
#
#
T 172.31.87.65:40224 -> 52.212.55.84:5222 [AP] #346
<presence from='user@xmpp.example.com/client-6' id='DSZAW-2' type='unavailable'/><a xmlns='urn:xmpp:sm:3' h='35'/></stream:stream>
####
With previous Smack version (4.3.x) there was no problem even if the server didn’t send the closing tag.
Why does this behavior occur, with the Smack version 4.4.x?
We took also the thread dumps, if necessary we can share them.
Thank for again for your help!