appmesh 3.1.5 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/appmesh_tcp.js +11 -5
package/package.json
CHANGED
package/src/appmesh_tcp.js
CHANGED
|
@@ -763,6 +763,7 @@ class AppMeshClientTCP extends AppMeshClient {
|
|
|
763
763
|
|
|
764
764
|
let exitCode = null
|
|
765
765
|
let failure = null
|
|
766
|
+
let disconnected = false // transport died — skip unsubscribe cleanup (SDKContract cleanup policy)
|
|
766
767
|
let deliveredUntil = 0 // next-byte offset already delivered
|
|
767
768
|
let done = false
|
|
768
769
|
let resolveWait
|
|
@@ -807,6 +808,7 @@ class AppMeshClientTCP extends AppMeshClient {
|
|
|
807
808
|
done = true
|
|
808
809
|
resolveWait()
|
|
809
810
|
} else if (event.event_type === EVENT_TYPE_DISCONNECTED) {
|
|
811
|
+
disconnected = true
|
|
810
812
|
if (exitCode === null && failure === null) {
|
|
811
813
|
failure = new TransportDisconnectedError(`transport disconnected while waiting for '${run.appName}' to exit`)
|
|
812
814
|
}
|
|
@@ -844,11 +846,15 @@ class AppMeshClientTCP extends AppMeshClient {
|
|
|
844
846
|
}
|
|
845
847
|
}
|
|
846
848
|
} finally {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
849
|
+
// Cleanup policy: after a disconnect the transport is dead — an unsubscribe
|
|
850
|
+
// would silently reconnect and register a never-answered waiter.
|
|
851
|
+
if (!disconnected) {
|
|
852
|
+
try {
|
|
853
|
+
if (sub && sub.subscription_id) {
|
|
854
|
+
await this.unsubscribe(sub.subscription_id)
|
|
855
|
+
}
|
|
856
|
+
} catch (_) { /* ignore */ }
|
|
857
|
+
}
|
|
852
858
|
|
|
853
859
|
// Best-effort delete on a real exit; on REMOVED/disconnect the app is already gone.
|
|
854
860
|
if (exitCode !== null && failure === null) {
|