branch puller reports failure for new hosted branches

Bug #49989 reported by David Allouche
6
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Jonathan Lange

Bug Description

Tags: supermirror branch puller sftp hosted

The SFTP server creates a new branch in the database on directory creation. Then the branch puller tries to pull that new branch on its next run, and fails if the push is still in progress, reporting that no branch data was found.

This error report is correct but misleading. Ideally, Launchpad should report "Initial SFTP upload in progress" (or likewise) at least until:

* the branch puller succeeded on that branch
* or the SFTP session that created the branch is complete

Tags: lp-code ui
David Allouche (ddaa)
Changed in launchpad-bazaar:
importance: Untriaged → Low
status: Unconfirmed → Confirmed
Revision history for this message
James Henstridge (jamesh) wrote :

The fix for this could be related to bug 48813.

If the SFTP server pinged the database about which branch directories were touched during the session (and hence should be pulled), then ideally we wouldn't try to pull a new branch til the sftp session was closed.

Revision history for this message
David Allouche (ddaa) wrote :

Interesting suggestion.

When it creates the branch, the sftp server could set a Branch.init_in_progress flag. When the session terminates, it would clear init_in_progress and set pull_now. When the sftp server starts it would clear all init_in_progress flags and set pull_now on the corresponding branches.

To avoid ignoring new data because of abnormally long lived sftp sessions, it would still be necessary to periodically pull all sftp branches, but if an error occurs when pulling a branch which has init_in_progress, it would be silently ignored.

Similarly, the first write operation on an existing branch could set "change_in_progress", that would be treated just as init_in_progress except for the status reporting in the web ui.

Revision history for this message
Steve Alexander (stevea) wrote :

This is a critical usability error. It needs a workaround immediately (such as a message in the UI), and fixing properly asap.

Changed in launchpad-bazaar:
assignee: nobody → spiv
importance: Low → Critical
Revision history for this message
Christian Reis (kiko) wrote :

I think the shared lock idea ddaa outlines is a good one, and likely to be simpler than other approaches.

Revision history for this message
Andrew Bennetts (spiv) wrote :

jml/launchpad/supermirrorsftp-call-requestMirror is likely to fix this. It's currently in the review queue.

Jonathan Lange (jml)
Changed in launchpad-bazaar:
status: Confirmed → In Progress
Revision history for this message
David Allouche (ddaa) wrote :

change assignee to the owner of the branch fixing the bug

Changed in launchpad-bazaar:
assignee: spiv → jml-mumak
Revision history for this message
Jonathan Lange (jml) wrote :

Fix committed. Recommend that this be landed on production as soon as possible.

Changed in launchpad-bazaar:
status: In Progress → Fix Committed
Revision history for this message
David Allouche (ddaa) wrote :

Got it live in production yesterday, after much wrestling.

Changed in launchpad-bazaar:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.