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

Connection timeout don't work until got message #1820

Open
liavAtWork opened this issue Nov 9, 2023 · 0 comments
Open

Connection timeout don't work until got message #1820

liavAtWork opened this issue Nov 9, 2023 · 0 comments

Comments

@liavAtWork
Copy link

liavAtWork commented Nov 9, 2023

example code:

    with Connection(self.broker_url, ssl=self.ssl, heartbeat=self.heartbeat) as conn:
        chan = conn.channel()
        with conn.Consumer(channel=chan, callbacks=[messageHandler]) as self.consumer:
            chan.basic_qos(prefetch_size=0, prefetch_count=self.prefetch_count, a_global=False)
            entry_time = time.time()
            self.logger.info('performing drain_events with drain_events_time_out=60')
            conn.drain_events(timeout=60)
            exit_time = time.time()
            time_in_drain_events = exit_time - entry_time
            self.logger.info('drain_events exited after time_in_drain_events=%s', time_in_drain_events)

got log like:
drain_events exited after time_in_drain_events=225.69921612739563
which is way more than the excepted 60s
checked my messages log and found that the connection doesn't respect the timeout if the connection do not got message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant