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

get_realtime_sec() freezes in reader.JournalReader #13

Open
poreklo opened this issue Feb 22, 2019 · 1 comment
Open

get_realtime_sec() freezes in reader.JournalReader #13

poreklo opened this issue Feb 22, 2019 · 1 comment

Comments

@poreklo
Copy link

poreklo commented Feb 22, 2019

When used cysystemd.reader.JournalReader a problem occurs.
get_monotonic_sec() works correctly and time updated at every line.
But get_realtime_sec() freeze for 128 seconds.

Test script:

#!/usr/bin/env python3

from cysystemd.reader import JournalOpenMode, JournalReader, Rule
import time

if __name__ == '__main__':
    j = JournalReader()
    j.open(JournalOpenMode.SYSTEM)
    j.seek_realtime_usec(time.time() * 1000000)
    while True:
        j.wait(1)
        for entry in j:
            print("date = {}, monotonic = {}, realtime = {}".format(
                entry.date, entry.get_monotonic_sec(), entry.get_realtime_sec()
))

and output:

date = 2019-02-22 05:26:24, monotonic = 1909098.0, realtime = 1550813184.0. Diff = 1548904086.0
date = 2019-02-22 05:26:24, monotonic = 1909099.0, realtime = 1550813184.0. Diff = 1548904085.0
date = 2019-02-22 05:26:24, monotonic = 1909099.0, realtime = 1550813184.0. Diff = 1548904085.0
date = 2019-02-22 05:26:24, monotonic = 1909099.0, realtime = 1550813184.0. Diff = 1548904085.0
date = 2019-02-22 05:26:24, monotonic = 1909099.0, realtime = 1550813184.0. Diff = 1548904085.0
date = 2019-02-22 05:26:24, monotonic = 1909102.0, realtime = 1550813184.0. Diff = 1548904082.0
date = 2019-02-22 05:26:24, monotonic = 1909103.0, realtime = 1550813184.0. Diff = 1548904081.0
date = 2019-02-22 05:26:24, monotonic = 1909104.0, realtime = 1550813184.0. Diff = 1548904080.0
date = 2019-02-22 05:26:24, monotonic = 1909104.0, realtime = 1550813184.0. Diff = 1548904080.0
date = 2019-02-22 05:26:24, monotonic = 1909105.0, realtime = 1550813184.0. Diff = 1548904079.0
date = 2019-02-22 05:28:32, monotonic = 1909106.0, realtime = 1550813312.0. Diff = 1548904206.0
date = 2019-02-22 05:28:32, monotonic = 1909107.0, realtime = 1550813312.0. Diff = 1548904205.0
date = 2019-02-22 05:28:32, monotonic = 1909107.0, realtime = 1550813312.0. Diff = 1548904205.0
date = 2019-02-22 05:28:32, monotonic = 1909107.0, realtime = 1550813312.0. Diff = 1548904205.0
date = 2019-02-22 05:28:32, monotonic = 1909108.0, realtime = 1550813312.0. Diff = 1548904204.0

I tested this script with Debian 9 (Python 3.5) and Ubuntu 18.04 (Python 3.6)

@mosquito
Copy link
Owner

Is it reproduces right now?

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

2 participants