Refresh of page returns different filetip

Issue #112 resolved
Joachim Tingvold
created an issue


Have an issue with Hatta; after changing/editing a page, for each refresh it will alternate between the newest and second newest version of the page.

The alternating content is returned by /+render/Foopage, and it's not cached in my web browser.

Digging some in the code, reveals that different filetip's are returned by _changectx(title) for each refresh for the same file;

First refresh:
repo_file: Foopage
self._tips[thread_id]: 724b03747e09
filetip: Foopage@724b03747e09

Second refresh:
repo_file: Foopage
self._tips[thread_id]: 0d8eb10a9b24
filetip: Foopage@0d8eb10a9b24

It goes on like this for "forever". Only after a reasonable amount of time, it stops (landing each refresh on the latest version).

Any clues as to what might cause this?

Comments (8)

  1. Radomir Dopieralski repo owner
    • changed status to open

    So it looks like one of the threads has the old information from the repository. I will have to investigate why Mercurial doesn't update that.

    Thank you for such detailed information and for your work debugging it!

  2. Joachim Tingvold reporter
    First refresh:
    repo_file: Foopage
    thread_id: 139905803450112
    self._tips[thread_id]: aae93454f8c9
    filetip: Foopage@aae93454f8c9
    Second refresh:
    repo_file: Foopage
    thread_id: 139905920947968
    self._tips[thread_id]: 1747e3c41e6d
    filetip: Foopage@1747e3c41e6d
  3. Joachim Tingvold reporter


    Sorry, this ended up on the bottom of the pile of things to do (-:

    Someone™ decided to change wiki we used -- not just because of this, but mainly because we ended up having multiple heads. This happened if we were 2-5 people editing the same page. The content of the wiki obviously went back to some very old commits;

    root@wen:/srv/vhosts/hatta/pages# hg heads
    changeset:   364:7c49fd38a41b
    tag:         tip
    user:        tg
    date:        Tue Mar 31 17:37:46 2015 +0200
    summary:     modified
    changeset:   362:5fe476eb84c5
    user:        tg
    date:        Tue Mar 31 17:25:45 2015 +0200
    summary:     modified
    changeset:   43:0758e0d26439
    user:        atrius
    date:        Sun Feb 08 00:23:58 2015 +0100
    summary:     modified

    Solved by cloning the repo with hg clone /srv/vhosts/hatta/pages fyttihatta-fix. Then we had this cronjob;

    exec >/tmp/fyttihatta-fix.log 2>&1
    set -x -e
    cd /var/lib/fyttihatta-fix
    hg pull
    hg up -C tip
    hg merge || true
    hg resolve --mark -a
    hg ci -u cron -m 'merge heads'
    hg push

    Yes, yes. Very ugly. It worked. Then we changed wiki :-P

  4. Radomir Dopieralski repo owner

    I think this is actually related to this bug, but I can't blame you for switching to a different wiki. Normally Hatta would attempt to merge edit conflicts, but if each instance sees a different tip, this is not possible. Thanks for the information though and good luck with your new wiki.

  5. Log in to comment