Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Losed subscription #162

@pablobragan

Description

@pablobragan

Hi,

We have a situtation when the app restart and for some reason didn't closed a subscription but did close the client connection. After the app starts again, the subscription connects ok but if I check one of the channels it is appeared to be one subscription tilt with all the pending messages. I restart the application a few times and the channel is like stalled. Even I have disconnected that client the subscription remains and when I hit the endpoint /streaming/channelsz
For example:
"subscriptions": [
{
"client_id": "client-id",
"inbox": "_INBOX.kVrYdqnAsSPrXZEKKWVKsi",
"ack_inbox": "_INBOX.E5IEx85O0cmdoFtQCnZDi7",
"queue_name": "queue-name",
"is_durable": true,
"is_offline": false,
"max_inflight": 550,
"ack_wait": 600000,
"last_sent": 470060,
"pending_count": 74922,
"is_stalled": false
},

It Is very weird that pending_count is larger than max_inflight and also, the others subscriptions we have on the same channel, same queue_name are almost lazy. I think pending_count there it's not real but affects all my statistics.

The application that consumes messages it's a kubernetes application and every pod have its clientId. When the statefulset is terminated we have a pre-close routine that closes every subscription and then closes nats-streaming client connection, so we don't know how we ended at this state.

I hope you could help me to get a solution to this situation.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions