Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nats aio client request using _request_new_style doesn't receive messages if it looses the subscrption #667

Open
ricardomfmartins opened this issue Feb 19, 2025 · 0 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@ricardomfmartins
Copy link

Observed behavior

On the following code if the subscription is lost, the instantiated client will no longer be able to receive the replies of any request because the subscription is not recreated.
This behavior wasn't happening on the old style request.
`async def _request_new_style(
self,
subject: str,
payload: bytes,
timeout: float = 1,
headers: Optional[Dict[str, Any]] = None,
) -> Msg:
if self.is_draining_pubs:
raise errors.ConnectionDrainingError

    if not self._resp_sub_prefix:
        await self._init_request_sub()
    assert self._resp_sub_prefix`

Expected behavior

if a subscription is lost a new one should be created.

Server and client version

https://github.com/nats-io/nats.py/releases/tag/v2.9.0

Host environment

No response

Steps to reproduce

I wasn't able to reproduce how I lost a subscription, but it already happened on some of our clients.

@ricardomfmartins ricardomfmartins added the defect Suspected defect such as a bug or regression label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

1 participant