pull: Update comment to better reflect current reality

This commit is contained in:
Colin Walters 2013-08-23 17:31:24 -04:00
parent 7751d3d9cd
commit db4aecee44
1 changed files with 24 additions and 36 deletions

View File

@ -24,45 +24,33 @@
* See: * See:
* https://mail.gnome.org/archives/ostree-list/2012-August/msg00021.html * https://mail.gnome.org/archives/ostree-list/2012-August/msg00021.html
* *
* DESIGN: * First, we synchronously fetch all requested refs, and resolve them
* to SHA256 commit checksums.
* *
* Pull refs * Now, there are two threads involved here. First, there's the
* For each ref: * calling thread; we create a temporary #GMainContext, and iterate
* Queue scan of commit * it. This thread performs all HTTP requests.
* *
* Mainloop: * The calling thread communicates with the "metadata scanning"
* Process requests, await idle scan * thread. The purpose of the metadata thread is to avoid blocking
* * the main thread while reading from the repository. If a
* Async queue: * transaction is interrupted for example, the next run will need to
* Scan commit * lstat() each loose object, which could easily be 60000 or more.
* If already cached, recursively scan content *
* If not, queue fetch * The two threads pass messages back and forth over queues. The deep
* * complexity in this code is determining when a pull process is
* For each commit: * complete. When the main thread completes fetching a metadata
* Verify checksum * object, it passes it over to the metadata thread, which may in turn
* Import * queue more work for the main thread. That in turn may generate
* Traverse and queue dirtree/dirmeta * more work for the metadata thread, etc.
* *
* Pull dirtrees: * Work completion is presently done via sending special _IDLE message
* For each dirtree: * down the queue; if both threads are idle, the main thread tells the
* Verify checksum * metadata thread to shut down, and then proceeds to stop iterating
* Import * the main context.
* Traverse and queue content/dirtree/dirmeta
*
* Pull content meta:
* For each content:
* Pull meta
* If contentcontent needed:
* Queue contentcontent
* else:
* Import
*
* Pull contentcontent:
* For each contentcontent
* Verify checksum
* Import
*
* *
* There is still a race condition here. See
* https://bugzilla.gnome.org/show_bug.cgi?id=706456
*/ */
#include "config.h" #include "config.h"