Comment 4 for bug 1627865

Revision history for this message
Colin Watson (cjwatson) wrote :

This bites Launchpad quite often, although the symptoms are different since Launchpad actually bothers to check the status code:

  https://bugs.launchpad.net/software-center-agent/+bug/1610948

There's certainly a race here, and your theory seems plausible. I think it's CreateApplicationTask that creates this row, and that's an asynchronous task scheduled by the preceding snap-push request.

Perhaps SnapPushHandler should create the ClickPackageUpload row itself rather than (or, for extra robustness, as well as) deferring the creation to CreateApplicationTask? The task would still fill in more detailed scan results when it has them, but this way we'd at least have a basic UNSCANNED row in SCA's database so that SnapPushStatusHandler is guaranteed to be able to see it immediately.

snapcraft should still of course check the status code as you suggest, even once SCA is fixed.