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.last_heartbeat_recv is timezone naive #36

Open
kundertk opened this issue Mar 14, 2018 · 0 comments
Open

Connection.last_heartbeat_recv is timezone naive #36

kundertk opened this issue Mar 14, 2018 · 0 comments

Comments

@kundertk
Copy link

When trying to detect connection failures on a connection, an application can look at the last_heartbeat_recv datetime(which comes from the underlying transport object) to determine if rabbitmq is still in communication. However, the object is timezone naive and when checking this object during DST transitions(on systems without DST disabled), there is no reliable way to determine how old the timestamp is.

Would it break any code if instead of

self.last_heartbeat_received = datetime.datetime.now()

it was changed to

self.last_heartbeat_received = datetime.datetime.now(tz=datetime.timezone.utc)

Presumably the last_heartbeat_sent date should also be in UTC as well.

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