Home / Companies / Rollbar / Blog / Post Details
Content Deep Dive

Daily summary email bugfix

Blog post from Rollbar

Post Details
Company
Date Published
Author
-
Word Count
501
Language
English
Hacker News Points
-
Summary

A bug in daily summary emails was identified, which led to missing error information due to a timezone handling miscalculation, affecting almost all customers. The issue, reported by a customer on May 1st, was eventually traced back to the use of time.mktime() that incorrectly assumed local timezone for a UTC datetime object. This resulted in inaccurate occurrence counts and missing errors in emails. The debugging process involved recreating database queries in a development environment and analyzing potential causes like MySQL slave delay and transactions, which were ruled out. Rollbar debugging revealed that the incorrect min_ts and max_ts values were due to the improper handling of the timezone. The problem was resolved by replacing time.mktime() with calendar.timegm(), which correctly handles UTC, offering a straightforward solution to prevent future timezone-related bugs.