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

Add: move all git operations into another process #71

Merged
merged 1 commit into from
Nov 11, 2020
Merged

Conversation

TrueBrain
Copy link
Owner

This drasticly speeds up the interface from a user-perspective,
and this is a fancy way of working around the GIL. Ideally we would
use a Git library that is async, which would also resolve this
issue, but with GitPython we are basically 4+ seconds waiting for
"git push" to finish. As that locks the GIL, no other request can
be handled while this is going on.

By moving the git operations to their own process, the main process
can safely continue to serve requests while in the background
git and GitHub are being updated. This is relative safe, as the
application itself doesn't care about git and/or GitHub. Locking
around the use of the out-of-process-git should prevent two
processes trying to access git and/or GitHub.

It is possible that if many people edit pages rapidly, that the
queue of things to commit gets long, and that commits start to
overlap. For example:
create page -> modify -> modify -> modify
All within 5 seconds, will most likely create only two commits,
one with the create, and the rest with all the modifications
in one. It is, however, rather unlikely humans can go through
the interface within 5 seconds to make sane modifications. So
this is considered an accepted edge-case.

This drasticly speeds up the interface from a user-perspective,
and this is a fancy way of working around the GIL. Ideally we would
use a Git library that is async, which would also resolve this
issue, but with GitPython we are basically 4+ seconds waiting for
"git push" to finish. As that locks the GIL, no other request can
be handled while this is going on.

By moving the git operations to their own process, the main process
can safely continue to serve requests while in the background
git and GitHub are being updated. This is relative safe, as the
application itself doesn't care about git and/or GitHub. Locking
around the use of the out-of-process-git should prevent two
processes trying to access git and/or GitHub.

It is possible that if many people edit pages rapidly, that the
queue of things to commit gets long, and that commits start to
overlap. For example:
 create page -> modify -> modify -> modify
All within 5 seconds, will most likely create only two commits,
one with the create, and the rest with all the modifications
in one. It is, however, rather unlikely humans can go through
the interface within 5 seconds to make sane modifications. So
this is considered an accepted edge-case.
@TrueBrain TrueBrain merged commit 992a26d into master Nov 11, 2020
@TrueBrain TrueBrain deleted the push_direct branch November 11, 2020 11:28
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

Successfully merging this pull request may close these issues.

None yet

1 participant