First request to a file at specific revision fails just after a push

Issue #839 resolved
Dan LaMotte created an issue

Cant really explain it, because if the page is requested again, it shows up magically...

For example:

Just after I push that rev to Rhodecode, if I go directly to that URL... it fails saying the file isn't in the repository. This causes a pull request to fail to be created and breaks integration with Review Board (because Review Board gets a 404 instead of the actual file existing).

It's very troublesome.

Comments (9)

  1. Dan LaMotte reporter

    That would help wouldn't it, sorry... 1.6.0 However, I'm 99% sure I saw it in 1.5.4 also.

  2. Marcin Kuzminski repo owner

    I often seen that issues when people used multiprocess setup with gunicorn or Apache. Then the cache was invalidated only on one process while the other had old cache, thus throwing errors about non-existing revisions.

  3. Dan LaMotte reporter

    That's definitely it then. I'm using multi-process gunicorn.

    What's the solution? Waitress? Running a single gunicorn?

    Why is there a process-local cache being used instead of a global cache like memcached? Do I need to configure something to use memcached/redis?

  4. Marcin Kuzminski repo owner

    Switch to Waitress or run single process gunicorn. Please read pt.3 on how basically run multiprocess setup.

    Process-local cache is used because Mercurial/Git objects are not serializable, they have to be kept in memory. I hope someday we'll build a better solution for that and we'll be able to use global cache system like redis or memcached.

  5. Dan LaMotte reporter

    Working much better now with waitress. Thanks.

    Basically, the instance_id is local to each process? But since a multi-process worker like gunicorn shares configuration between the process, it fails?

    This should be resolved now I would think. Thanks for the quick help.

  6. Marcin Kuzminski repo owner

    yes, if you could make gunicorn run two processes with different .ini file that should work fine in theory. In next release we're done some more work to make this system better, for example you don't need to specify separate .ini file. But for now i recommend using it with load-balancing setup like in docs. Cheers

  7. Log in to comment