Re: Best way to pause/resume ostree_pull_with_options





On Thu, Sep 27, 2018, at 5:46 AM, Anton Gerasimov via ostree-list wrote:

does someone here have experience/ideas about how to implement pausing and
resuming pull when using OSTree as a library?
The best thing I could come up with is cancelling the pull through
GCancellable and restarting it again. Do you think it will work? Is there a
better way?

I'm guessing the intention of "pause" here is from a network perspective,
but there's also e.g. disk I/O.  We could be doing background writes/fsyncs.
If you want to pause the I/O too...probably the best approach is indeed truly
cancellation.

If you just want to pause *briefly* - one approach could be to run
the pull in a thread with its own mainloop, and simply stop iterating
the mainloop.  But if you do that for too long, the webserver is
likely to close the connection, effectively cancelling things anyways.

Definitely an intention of the current design is to support cancel+resume
to make things incremental - libostree allocates "staging" subdirectories
in tmp/ that are opportunistically reused across fetches for resume, although
see e.g. https://github.com/ostreedev/ostree/issues/1019




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]