)]}'
{"id":"openstack%2Fglance~748014","triplet_id":"openstack%2Fglance~stable%2Fussuri~Icb3c1d27e9a514d96fca7c1d824fd2183f69d8b3","project":"openstack/glance","branch":"stable/ussuri","topic":"bug/1884596","hashtags":[],"change_id":"Icb3c1d27e9a514d96fca7c1d824fd2183f69d8b3","subject":"Implement time-limited import locking","status":"MERGED","created":"2020-08-25 18:57:25.000000000","updated":"2020-08-28 12:01:16.000000000","submitted":"2020-08-28 11:56:19.000000000","submitter":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"total_comment_count":0,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"748014-1598615780013-98515791","meta_rev_id":"3dc00753632cf49a050f2d2d4fdfa7601d77af83","_number":748014,"virtual_id_number":748014,"owner":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"all":[{"tag":"autogenerated:zuul:gate","value":2,"date":"2020-08-28 11:56:19.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":0,"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"value":0,"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"}],"values":{"-2":"Fails","-1":"Doesn\u0027t seem to work"," 0":"No score","+1":"Works for me","+2":"Verified"},"description":"","default_value":0,"optional":true},"Code-Review":{"approved":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"all":[{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":2,"date":"2020-08-26 13:47:35.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"value":2,"date":"2020-08-26 21:13:47.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"}],"values":{"-2":"Do not merge","-1":"This patch needs further work before it can be merged"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me (core reviewer)"},"description":"","default_value":0,"optional":true},"Workflow":{"approved":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"all":[{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":0,"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"value":1,"date":"2020-08-26 21:13:47.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"}],"values":{"-1":"Work in progress"," 0":"Ready for reviews","+1":"Approved"},"description":"","default_value":0,"optional":true},"Review-Priority":{"recommended":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"all":[{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":1,"date":"2020-08-26 13:47:35.000000000","permitted_voting_range":{"min":1,"max":2},"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"value":0,"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"}],"values":{"-1":"Branch Freeze"," 0":"No Priority","+1":"Important Change","+2":"Top Priority / Holds Gate"},"description":"","value":1,"default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2020-08-26 06:58:22.000000000","updated_by":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"reviewer":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"state":"REVIEWER"},{"updated":"2020-08-26 21:13:47.000000000","updated_by":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"reviewer":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"state":"REVIEWER"},{"updated":"2020-08-28 11:56:19.000000000","updated_by":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"reviewer":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"state":"REVIEWER"}],"messages":[{"id":"ad468f0a767bc38416856348beedebab1b890da3","author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"date":"2020-08-25 18:57:25.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"e8eb1c359d57103bff29825ead06a50d397b5b4f","tag":"autogenerated:zuul:check","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2020-08-25 20:40:34.000000000","message":"Patch Set 1: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade https://zuul.opendev.org/t/openstack/build/861225b005e0455e9ab3d02d0e68e3e2 : SUCCESS in 1h 37m 23s\n- tempest-integrated-storage https://zuul.opendev.org/t/openstack/build/819f14de5e5c4c039dbffb692cf6ac41 : SUCCESS in 1h 10m 06s\n- openstack-tox-lower-constraints https://zuul.opendev.org/t/openstack/build/89d4f437707e4571833cb69656e77eca : SUCCESS in 9m 08s\n- openstack-tox-pep8 https://zuul.opendev.org/t/openstack/build/28207b51c27546ef9241a8ec90c2431f : SUCCESS in 5m 47s\n- openstack-tox-py36 https://zuul.opendev.org/t/openstack/build/77e1686718634ec6adfe81f3250c8960 : SUCCESS in 7m 42s\n- openstack-tox-py37 https://zuul.opendev.org/t/openstack/build/6d1fe78752e3424390ad7f26289eccff : SUCCESS in 6m 07s\n- openstack-tox-docs https://zuul.opendev.org/t/openstack/build/f3b474ddc95141a2976d638b33b1f74a : SUCCESS in 6m 47s\n- openstack-tox-functional-py36 https://zuul.opendev.org/t/openstack/build/5a711ec6fe244af0aaffe86087ade71e : SUCCESS in 14m 56s\n- openstack-tox-functional-py37 https://zuul.opendev.org/t/openstack/build/62992124e0b24853a8dc0b2cdec51a25 : SUCCESS in 10m 51s\n- glance-code-constants-check https://zuul.opendev.org/t/openstack/build/6a96cae9ac1c4a75b9ea7e37778708d4 : SUCCESS in 5m 26s\n- devstack-plugin-ceph-tempest-py3 https://zuul.opendev.org/t/openstack/build/efd0874f34634d168fc6ba6606fe781f : SUCCESS in 57m 47s (non-voting)\n- tempest-ipv6-only https://zuul.opendev.org/t/openstack/build/9af65b660ca7450a9197a024d57a2142 : SUCCESS in 55m 03s","accounts_in_message":[],"_revision_number":1},{"id":"b795aca6aa2bd6a76602c16b9df35d53f7aa78ed","author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"date":"2020-08-26 06:58:22.000000000","message":"Patch Set 1: Code-Review+2 Review-Priority+1","accounts_in_message":[],"_revision_number":1},{"id":"e4fb46c336628c56695ad8a816d9dd1082b9276a","author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"date":"2020-08-26 13:47:35.000000000","message":"Uploaded patch set 2: Patch Set 1 was rebased.","accounts_in_message":[],"_revision_number":2},{"id":"10f0a2546eed4c1862c9f939c29c83ed7f5f3f3e","tag":"autogenerated:zuul:check","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2020-08-26 19:04:31.000000000","message":"Patch Set 2: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade https://zuul.opendev.org/t/openstack/build/1a51712437e8487eb3e08beb6d840570 : SUCCESS in 1h 39m 07s\n- tempest-integrated-storage https://zuul.opendev.org/t/openstack/build/ea1d628ddb6d4b8484ac0024458b4017 : SUCCESS in 1h 07m 15s\n- openstack-tox-lower-constraints https://zuul.opendev.org/t/openstack/build/a0d98c939e584a4a94d6abe7eacb6fc9 : SUCCESS in 4m 32s\n- openstack-tox-pep8 https://zuul.opendev.org/t/openstack/build/7110125509d1423c9f00e747b8b130c4 : SUCCESS in 5m 36s\n- openstack-tox-py36 https://zuul.opendev.org/t/openstack/build/8f0f2ebaca894947bfbcbc8a44b63c84 : SUCCESS in 6m 58s\n- openstack-tox-py37 https://zuul.opendev.org/t/openstack/build/a28205a5dd0b46a0805fed1aece77961 : SUCCESS in 9m 46s\n- openstack-tox-docs https://zuul.opendev.org/t/openstack/build/f5a0519a2c6b49bfbdbcf6116214fc93 : SUCCESS in 10m 33s\n- openstack-tox-functional-py36 https://zuul.opendev.org/t/openstack/build/dc23d49c31f544529d3af16daa0849f6 : SUCCESS in 6m 26s\n- openstack-tox-functional-py37 https://zuul.opendev.org/t/openstack/build/635dbd061e4c473fb89f00248f44bebe : SUCCESS in 7m 51s\n- glance-code-constants-check https://zuul.opendev.org/t/openstack/build/d00b8ded420244d7905c13402ba5d5ca : SUCCESS in 4m 34s\n- devstack-plugin-ceph-tempest-py3 https://zuul.opendev.org/t/openstack/build/c17c5e6ebd664d22b8aeaae63eb77dce : SUCCESS in 1h 07m 38s (non-voting)\n- tempest-ipv6-only https://zuul.opendev.org/t/openstack/build/e269c467ff79428f83065210772f4148 : SUCCESS in 58m 06s","accounts_in_message":[],"_revision_number":2},{"id":"04e23a0a9aecc8ec9e9aed2e4fc20ea5ec08bce1","author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"date":"2020-08-26 21:13:47.000000000","message":"Patch Set 2: Code-Review+2 Workflow+1","accounts_in_message":[],"_revision_number":2},{"id":"e020851d7f980555f73e60265449872f91083781","tag":"autogenerated:zuul:gate","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2020-08-27 09:15:26.000000000","message":"Patch Set 2: -Verified\n\nStarting gate jobs.","accounts_in_message":[],"_revision_number":2},{"id":"08efd70d184680bbca2cd37804408b0c3e5849f6","tag":"autogenerated:zuul:gate","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2020-08-27 23:13:59.000000000","message":"Patch Set 2: Verified-2\n\nThis change depends on a change that failed to merge.","accounts_in_message":[],"_revision_number":2},{"id":"05920e143f2d0f56c995c2a07b7b44440589c877","author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"date":"2020-08-28 05:51:28.000000000","message":"Patch Set 2:\n\nrecheck","accounts_in_message":[],"_revision_number":2},{"id":"e5e43e638696f397161c6fafae2449411bc1dc16","tag":"autogenerated:zuul:check","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2020-08-28 07:10:56.000000000","message":"Patch Set 2: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade https://zuul.opendev.org/t/openstack/build/68093968b77a43d6bed985da01ca0e73 : SUCCESS in 1h 12m 02s\n- tempest-integrated-storage https://zuul.opendev.org/t/openstack/build/25073751b7d3473f87e28ca289d0ae27 : SUCCESS in 1h 10m 29s\n- openstack-tox-lower-constraints https://zuul.opendev.org/t/openstack/build/888730b6a04c43dd9777be66a5ea4c3b : SUCCESS in 6m 11s\n- openstack-tox-pep8 https://zuul.opendev.org/t/openstack/build/ad469d9b2ff843bc8cc79d2bf9f94d6a : SUCCESS in 4m 59s\n- openstack-tox-py36 https://zuul.opendev.org/t/openstack/build/77a1201b7998468b91ba42f365f73ccb : SUCCESS in 4m 34s\n- openstack-tox-py37 https://zuul.opendev.org/t/openstack/build/583e3aefceec473ba72c6c1a3d1672d4 : SUCCESS in 4m 42s\n- openstack-tox-docs https://zuul.opendev.org/t/openstack/build/bf80e8352fd448ef863af8ca995d7cfc : SUCCESS in 7m 19s\n- openstack-tox-functional-py36 https://zuul.opendev.org/t/openstack/build/ee12f489462b4273808cc731feb45d46 : SUCCESS in 6m 51s\n- openstack-tox-functional-py37 https://zuul.opendev.org/t/openstack/build/a2420d1aff164008b3dc088ec0078109 : SUCCESS in 7m 32s\n- glance-code-constants-check https://zuul.opendev.org/t/openstack/build/40542d98ff6c434ba08f1e2174318a8e : SUCCESS in 4m 05s\n- devstack-plugin-ceph-tempest-py3 https://zuul.opendev.org/t/openstack/build/670d56d5b5ce430b8ecbef22c892d043 : SUCCESS in 1h 02m 05s (non-voting)\n- tempest-ipv6-only https://zuul.opendev.org/t/openstack/build/aad499aa226647028d1a2d1c595cbc12 : SUCCESS in 57m 29s","accounts_in_message":[],"_revision_number":2},{"id":"104acb429e0ca5abcbd9ae9b964dab08773afe3d","tag":"autogenerated:zuul:gate","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2020-08-28 09:21:21.000000000","message":"Patch Set 2: -Verified\n\nStarting gate jobs.","accounts_in_message":[],"_revision_number":2},{"id":"e8c498bfaafd84ca4480985b9abe8963833e8513","tag":"autogenerated:zuul:gate","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2020-08-28 11:56:19.000000000","message":"Patch Set 2: Verified+2\n\nBuild succeeded (gate pipeline).\n\n- grenade https://zuul.opendev.org/t/openstack/build/36ccd246cf16472cb870ddc4aef415c7 : SUCCESS in 1h 16m 07s\n- tempest-integrated-storage https://zuul.opendev.org/t/openstack/build/2dbff79f52114a278e6af9a43ab04cd7 : SUCCESS in 1h 09m 43s\n- openstack-tox-lower-constraints https://zuul.opendev.org/t/openstack/build/e5fa4670dc1445e1997f5442832716f2 : SUCCESS in 4m 56s\n- openstack-tox-pep8 https://zuul.opendev.org/t/openstack/build/ac73943792ea4defa69c8750f9964a6a : SUCCESS in 6m 46s\n- openstack-tox-py36 https://zuul.opendev.org/t/openstack/build/b6cd87c0fba04556990b78d19dc3d070 : SUCCESS in 5m 25s\n- openstack-tox-py37 https://zuul.opendev.org/t/openstack/build/d693028f55b740caa647af81f1adae09 : SUCCESS in 7m 47s\n- openstack-tox-docs https://zuul.opendev.org/t/openstack/build/b9ed07f214c14293a9107145289481dc : SUCCESS in 7m 48s\n- openstack-tox-functional-py36 https://zuul.opendev.org/t/openstack/build/3fc423722bef417db993193c6ee1b02a : SUCCESS in 9m 22s\n- openstack-tox-functional-py37 https://zuul.opendev.org/t/openstack/build/9ef6009f91fb4fffb0d604a13f34576f : SUCCESS in 11m 28s\n- tempest-ipv6-only https://zuul.opendev.org/t/openstack/build/3c5865f4964c4993abd54b5c449184a8 : SUCCESS in 52m 17s","accounts_in_message":[],"_revision_number":2},{"id":"a24f97bc94a7b22116bce563b83646e47f1b7f74","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2020-08-28 11:56:20.000000000","message":"Change has been successfully merged by Zuul","accounts_in_message":[],"_revision_number":2},{"id":"75804fc63c047fce94522c3953dda60a6e4ef98a","tag":"autogenerated:zuul:promote","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2020-08-28 12:01:16.000000000","message":"Patch Set 2:\n\nBuild succeeded (promote pipeline).\n\n- promote-openstack-tox-docs https://zuul.opendev.org/t/openstack/build/974d2470046844ac8099e3e9d75780eb : SUCCESS in 1m 52s","accounts_in_message":[],"_revision_number":2}],"current_revision_number":2,"current_revision":"055e5e790272cf6a636b07a5ff0c4c2b59351fe7","revisions":{"111eed23602ffebbb49eae40f11e631da6b77d52":{"kind":"REWORK","_number":1,"created":"2020-08-25 18:57:25.000000000","uploader":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"ref":"refs/changes/14/748014/1","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/glance","ref":"refs/changes/14/748014/1","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/glance refs/changes/14/748014/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/glance refs/changes/14/748014/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/glance refs/changes/14/748014/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/glance refs/changes/14/748014/1"}}},"commit":{"parents":[{"commit":"a1b7a2666daea4b84daf08f7c70b6eee419b53b1","subject":"Add context.elevated() helper for getting admin privileges","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/glance/commit/a1b7a2666daea4b84daf08f7c70b6eee419b53b1"}]}],"author":{"name":"Dan Smith","email":"dansmith@redhat.com","date":"2020-07-28 16:02:13.000000000","tz":-420},"committer":{"name":"Dan Smith","email":"dansmith@redhat.com","date":"2020-08-25 18:53:33.000000000","tz":-420},"subject":"Implement time-limited import locking","message":"Implement time-limited import locking\n\nThis attempts to provide a time-based import lock that is dependent\non the task actually making progress. While the task is copying\ndata, the task message is updated, which in turn touches the task\nupdated_at time. The API will break any lock after 30 minutes of\nno activity on a stalled or dead task. The import taskflow will\ncheck to see if it has lost the lock at any point, and/or if its\ntask status has changed and abort if so.\n\nThe logic in more detail:\n\n1. API locks the image by task-id before we start the task thread, but\n   before we return\n2. Import thread will check the task-id lock on the image every time it\n   tries to modify the image, and if it has changed, will abort\n3. The data pipeline will heartbeat the task every minute by updating\n   the task.message (bonus: we get some status)\n4. If the data pipeline heartbeat ever finds the task state to be changed\n   from the expected \u0027processing\u0027 it will abort\n5. On task revert or completion, we drop the task-id lock from the image\n6. If something ever gets stuck or dies, the heartbeating will stop\n7. If the API gets a request for an import where the lock is held, it\n   will grab the task by id (in the lock) and check the state and age.\n   If the age is sufficiently old (no heartbeating) and the state is\n   either \u0027processing\u0027 or terminal, it will mark the task as failed,\n   steal the lock, and proceed.\n\nLots of logging throughout any time we encounter unexpected situations.\n\nConflicts:\n - Changes due to policy check being missing from ussuri\n\nCloses-Bug: #1884596\nChange-Id: Icb3c1d27e9a514d96fca7c1d824fd2183f69d8b3\n(cherry picked from commit 3f6e349d0853a9746d0d744bc3eb0b2baa1ddff9)\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/glance/commit/111eed23602ffebbb49eae40f11e631da6b77d52"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/glance/commit/111eed23602ffebbb49eae40f11e631da6b77d52"}]},"branch":"refs/heads/stable/ussuri"},"055e5e790272cf6a636b07a5ff0c4c2b59351fe7":{"kind":"TRIVIAL_REBASE","_number":2,"created":"2020-08-26 13:47:35.000000000","uploader":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"ref":"refs/changes/14/748014/2","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/glance","ref":"refs/changes/14/748014/2","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/glance refs/changes/14/748014/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/glance refs/changes/14/748014/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/glance refs/changes/14/748014/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/glance refs/changes/14/748014/2"}}},"commit":{"parents":[{"commit":"5998933acf2358070e9aa14ebb9e712985b5a04c","subject":"Add context.elevated() helper for getting admin privileges","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/glance/commit/5998933acf2358070e9aa14ebb9e712985b5a04c"}]}],"author":{"name":"Dan Smith","email":"dansmith@redhat.com","date":"2020-07-28 16:02:13.000000000","tz":-420},"committer":{"name":"Dan Smith","email":"dansmith@redhat.com","date":"2020-08-26 13:47:27.000000000","tz":-420},"subject":"Implement time-limited import locking","message":"Implement time-limited import locking\n\nThis attempts to provide a time-based import lock that is dependent\non the task actually making progress. While the task is copying\ndata, the task message is updated, which in turn touches the task\nupdated_at time. The API will break any lock after 30 minutes of\nno activity on a stalled or dead task. The import taskflow will\ncheck to see if it has lost the lock at any point, and/or if its\ntask status has changed and abort if so.\n\nThe logic in more detail:\n\n1. API locks the image by task-id before we start the task thread, but\n   before we return\n2. Import thread will check the task-id lock on the image every time it\n   tries to modify the image, and if it has changed, will abort\n3. The data pipeline will heartbeat the task every minute by updating\n   the task.message (bonus: we get some status)\n4. If the data pipeline heartbeat ever finds the task state to be changed\n   from the expected \u0027processing\u0027 it will abort\n5. On task revert or completion, we drop the task-id lock from the image\n6. If something ever gets stuck or dies, the heartbeating will stop\n7. If the API gets a request for an import where the lock is held, it\n   will grab the task by id (in the lock) and check the state and age.\n   If the age is sufficiently old (no heartbeating) and the state is\n   either \u0027processing\u0027 or terminal, it will mark the task as failed,\n   steal the lock, and proceed.\n\nLots of logging throughout any time we encounter unexpected situations.\n\nConflicts:\n - Changes due to policy check being missing from ussuri\n\nCloses-Bug: #1884596\nChange-Id: Icb3c1d27e9a514d96fca7c1d824fd2183f69d8b3\n(cherry picked from commit 3f6e349d0853a9746d0d744bc3eb0b2baa1ddff9)\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/glance/commit/055e5e790272cf6a636b07a5ff0c4c2b59351fe7"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/glance/commit/055e5e790272cf6a636b07a5ff0c4c2b59351fe7"}]},"branch":"refs/heads/stable/ussuri"}},"requirements":[],"submit_records":[],"submit_requirements":[]}
