# Buggy code
def update_tracker_info(self, tracker_url, is_successful):
    """
    Updates a tracker information.
    :param tracker_url: The given tracker_url.
    :param is_successful: If the check was successful.
    """

    if tracker_url == "DHT":
        return

    sanitized_tracker_url = get_uniformed_tracker_url(tracker_url)
    tracker = self.tracker_store.get(lambda g: g.url == sanitized_tracker_url)

    if not tracker:
        self._logger.error(
            "Trying to update the tracker info of an unknown tracker URL"
        )
        return

    current_time = int(time.time())
    failures = 0 if is_successful else tracker.failures + 1
    is_alive = tracker.alive < MAX_TRACKER_FAILURES

    # update the dict
    tracker.last_check = current_time
    tracker.failures = failures
    tracker.alive = is_alive


# Traceback (RuntimeError)
[PID:19277] 2020-02-19 20:12:31,372 - ERROR <session:369> Session.unhandled_error_observer(): Got unhandled error: Python int too large to convert to SQLite INTEGER
File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/vader/src/TRIBLER/Tribler/src/pyipv8/ipv8/taskmanager.py", line 104, in done_cb
future.result()
File "/home/vader/src/TRIBLER/Tribler/src/pyipv8/ipv8/taskmanager.py", line 13, in interval_runner
await task(*args)
File "/home/vader/src/TRIBLER/Tribler/src/tribler-core/tribler_core/modules/torrent_checker/torrent_checker.py", line 115, in check_random_tracker
infohashes = [t.infohash for t in torrents[:MAX_TORRENTS_CHECKED_PER_SESSION]]
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/orm/core.py", line 6162, in __getitem__
return query._fetch(limit=stop-start, offset=start)
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/orm/core.py", line 6164, in _fetch
return QueryResult(query, limit, offset, lazy=lazy)
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/orm/core.py", line 6271, in __init__
self._items = None if lazy else self._query._actual_fetch(limit, offset)
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/orm/core.py", line 5804, in _actual_fetch
cursor = database._exec_sql(sql, arguments)
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/orm/core.py", line 945, in _exec_sql
connection = cache.reconnect(e)
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/orm/core.py", line 1779, in reconnect
if not provider.should_reconnect(exc): reraise(*sys.exc_info())
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/utils/utils.py", line 95, in reraise
try: raise exc.with_traceback(tb)
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/orm/core.py", line 943, in _exec_sql
try: new_id = provider.execute(cursor, sql, arguments, returning_id)
File "<string>", line 2, in execute
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/orm/dbapiprovider.py", line 53, in wrap_dbapi_exceptions
try: return func(provider, *args, **kwargs)
File "/home/vader/src/TRIBLER/py37venv2/lib/python3.7/site-packages/pony/orm/dbapiprovider.py", line 270, in execute
else: cursor.execute(sql, arguments)
[PID:19220] 2020-02-19 20:12:31,395 - ERROR <tribler_window:104> root.on_exception(): Traceback (most recent call last):
File "/home/vader/src/TRIBLER/Tribler/src/tribler-gui/tribler_gui/event_request_manager.py", line 114, in on_read_data
raise RuntimeError(json_dict["event"]["text"])
RuntimeError: Python int too large to convert to SQLite INTEGER

# Fixed code
def update_tracker_info(self, tracker_url, is_successful):
    """
    Updates a tracker information.
    :param tracker_url: The given tracker_url.
    :param is_successful: If the check was successful.
    """

    if tracker_url == "DHT":
        return

    sanitized_tracker_url = get_uniformed_tracker_url(tracker_url)
    tracker = self.tracker_store.get(lambda g: g.url == sanitized_tracker_url)

    if not tracker:
        self._logger.error(
            "Trying to update the tracker info of an unknown tracker URL"
        )
        return

    current_time = int(time.time())
    failures = 0 if is_successful else tracker.failures + 1
    is_alive = failures < MAX_TRACKER_FAILURES

    # update the dict
    tracker.last_check = current_time
    tracker.failures = failures
    tracker.alive = is_alive