)]}'
{"tests/test-core-openstack.sh":[{"author":{"_account_id":32553,"name":"Sven Kieske","email":"sven_oss@posteo.de","username":"skieske"},"change_message_id":"371fea5b59f58d3b004361bb3a6333dbd6cb779b","unresolved":true,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    openstack server resize --flavor m2.tiny --wait ${name}"},{"line_number":188,"context_line":"    # If the status is not VERIFY_RESIZE, print info and exit 1"},{"line_number":189,"context_line":"    if [[ $(openstack server show ${name} -f value -c status) !\u003d \"VERIFY_RESIZE\" ]]; then"},{"line_number":190,"context_line":"        echo \"FAILED: Instance is not resized\""},{"line_number":191,"context_line":"        openstack --debug server show ${name}"},{"line_number":192,"context_line":"        return 1"},{"line_number":193,"context_line":"    fi"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    openstack server resize confirm ${name}"},{"line_number":196,"context_line":"    # If the status is not ACTIVE, print info and exit 1"}],"source_content_type":"text/x-sh","patch_set":3,"id":"dfa64b96_29fdd5d7","line":193,"range":{"start_line":189,"start_character":3,"end_line":193,"end_character":6},"updated":"2023-12-22 11:27:10.000000000","message":"this seems like a race condition to me.\n\naccording to the docs[1]:\n\n\u003e By default, the openstack server resize command gives the guest operating system a chance to perform a controlled shutdown before the instance is powered off and the instance is resized. This behavior can be configured by the administrator but it can also be overridden on a per image basis using the os_shutdown_timeout image metadata setting. This allows different types of operating systems to specify how much time they need to shut down cleanly. See Useful image properties for details.\n\n\u003e Resizing can take some time. During this time, the instance status will be RESIZE\n\nSo shouldn\u0027t we first check for this? we imho also might need a loop, because the time needed for each step is not really static, is it?\n\n[1]: https://docs.openstack.org/nova/latest/user/resize.html","commit_id":"e96a4a2fecc0ec32bc14e41371aa9f59fcfe2cef"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"b0aa3a4a654458937f692e6819e54d55066615da","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    openstack server resize --flavor m2.tiny --wait ${name}"},{"line_number":188,"context_line":"    # If the status is not VERIFY_RESIZE, print info and exit 1"},{"line_number":189,"context_line":"    if [[ $(openstack server show ${name} -f value -c status) !\u003d \"VERIFY_RESIZE\" ]]; then"},{"line_number":190,"context_line":"        echo \"FAILED: Instance is not resized\""},{"line_number":191,"context_line":"        openstack --debug server show ${name}"},{"line_number":192,"context_line":"        return 1"},{"line_number":193,"context_line":"    fi"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    openstack server resize confirm ${name}"},{"line_number":196,"context_line":"    # If the status is not ACTIVE, print info and exit 1"}],"source_content_type":"text/x-sh","patch_set":3,"id":"a56f6f9d_890c1af0","line":193,"range":{"start_line":189,"start_character":3,"end_line":193,"end_character":6},"in_reply_to":"dfa64b96_29fdd5d7","updated":"2023-12-22 11:42:12.000000000","message":"This is why I use the `--wait` option: \"Wait for resize to complete\".","commit_id":"e96a4a2fecc0ec32bc14e41371aa9f59fcfe2cef"},{"author":{"_account_id":32553,"name":"Sven Kieske","email":"sven_oss@posteo.de","username":"skieske"},"change_message_id":"04c34b13ff06712004247e47fa84eecfe724c95d","unresolved":true,"context_lines":[{"line_number":193,"context_line":"    fi"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    openstack server resize confirm ${name}"},{"line_number":196,"context_line":"    sleep 10"},{"line_number":197,"context_line":"    # If the status is not ACTIVE, print info and exit 1"},{"line_number":198,"context_line":"    if [[ $(openstack server show ${name} -f value -c status) !\u003d \"ACTIVE\" ]]; then"},{"line_number":199,"context_line":"        echo \"FAILED: Instance is not active after resize confirm\""}],"source_content_type":"text/x-sh","patch_set":5,"id":"7597aba5_47061e47","line":196,"range":{"start_line":196,"start_character":0,"end_line":196,"end_character":2},"updated":"2023-12-22 14:22:03.000000000","message":"this seems racy.\nand sleep is not a good way to avoid race conditions.","commit_id":"b54a2be031464933c11c6abb201d609025ba4211"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"a1a53707ffb1e8a8c5579b1a7ae096e2dc024f12","unresolved":true,"context_lines":[{"line_number":193,"context_line":"    fi"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    openstack server resize confirm ${name}"},{"line_number":196,"context_line":"    sleep 10"},{"line_number":197,"context_line":"    # If the status is not ACTIVE, print info and exit 1"},{"line_number":198,"context_line":"    if [[ $(openstack server show ${name} -f value -c status) !\u003d \"ACTIVE\" ]]; then"},{"line_number":199,"context_line":"        echo \"FAILED: Instance is not active after resize confirm\""}],"source_content_type":"text/x-sh","patch_set":5,"id":"cecd7838_aeb798a9","line":196,"range":{"start_line":196,"start_character":0,"end_line":196,"end_character":2},"in_reply_to":"087b1a43_9322c6d6","updated":"2024-01-04 23:09:37.000000000","message":"@Sven: I added a loop somewhat inspired by your suggestion. Would you be happy with this version?","commit_id":"b54a2be031464933c11c6abb201d609025ba4211"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"14962de770acf2d5255dbd03cb795b28267cf763","unresolved":true,"context_lines":[{"line_number":193,"context_line":"    fi"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    openstack server resize confirm ${name}"},{"line_number":196,"context_line":"    sleep 10"},{"line_number":197,"context_line":"    # If the status is not ACTIVE, print info and exit 1"},{"line_number":198,"context_line":"    if [[ $(openstack server show ${name} -f value -c status) !\u003d \"ACTIVE\" ]]; then"},{"line_number":199,"context_line":"        echo \"FAILED: Instance is not active after resize confirm\""}],"source_content_type":"text/x-sh","patch_set":5,"id":"087b1a43_9322c6d6","line":196,"range":{"start_line":196,"start_character":0,"end_line":196,"end_character":2},"in_reply_to":"0da94d3b_d4d17079","updated":"2023-12-27 20:26:02.000000000","message":"The first resize command has a --wait flag, so we don\u0027t need to sleep: we just wait for the resize action to finish.\n\nOnce finished, the instance is in VERIFY_RESIZE state until we run `resize confirm` on it. However, this command is asynchronous, and while it can look instantaneous when run interactively, running it in CI showed that we need to wait a small time for Nova to actually perform the action. It is possible a `sleep 1` might have been enough, but I imagine CI instances can sometimes be a bit slower than normal.","commit_id":"b54a2be031464933c11c6abb201d609025ba4211"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"a142ebba5945f0bb7c04df68f132c99f0067bada","unresolved":true,"context_lines":[{"line_number":193,"context_line":"    fi"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    openstack server resize confirm ${name}"},{"line_number":196,"context_line":"    sleep 10"},{"line_number":197,"context_line":"    # If the status is not ACTIVE, print info and exit 1"},{"line_number":198,"context_line":"    if [[ $(openstack server show ${name} -f value -c status) !\u003d \"ACTIVE\" ]]; then"},{"line_number":199,"context_line":"        echo \"FAILED: Instance is not active after resize confirm\""}],"source_content_type":"text/x-sh","patch_set":5,"id":"1128f4e4_084112e6","line":196,"range":{"start_line":196,"start_character":0,"end_line":196,"end_character":2},"in_reply_to":"7597aba5_47061e47","updated":"2023-12-22 14:26:51.000000000","message":"The resize confirm operation is normally a quick one in this context. I added this sleep because a few CI checks were failing on line 198, but by the time they reached `openstack --debug server show` on line 200 it was already ACTIVE.\n\nBut if you prefer I can add a loop waiting for the status to change until a timeout.","commit_id":"b54a2be031464933c11c6abb201d609025ba4211"},{"author":{"_account_id":32553,"name":"Sven Kieske","email":"sven_oss@posteo.de","username":"skieske"},"change_message_id":"4a0f016bf22d6115b0306f67341c0d028153a0e2","unresolved":true,"context_lines":[{"line_number":193,"context_line":"    fi"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    openstack server resize confirm ${name}"},{"line_number":196,"context_line":"    sleep 10"},{"line_number":197,"context_line":"    # If the status is not ACTIVE, print info and exit 1"},{"line_number":198,"context_line":"    if [[ $(openstack server show ${name} -f value -c status) !\u003d \"ACTIVE\" ]]; then"},{"line_number":199,"context_line":"        echo \"FAILED: Instance is not active after resize confirm\""}],"source_content_type":"text/x-sh","patch_set":5,"id":"c3ebf8a9_91dd8bc2","line":196,"range":{"start_line":196,"start_character":0,"end_line":196,"end_character":2},"in_reply_to":"7597aba5_47061e47","updated":"2023-12-22 14:28:06.000000000","message":"this is a little bit faster, at least:\n```\ncounter\u003d0\nwhile true; do\n  openstack server resize confirm \"$name\" \u0026\u0026 break\n  counter\u003d$((counter+1))\n  if [ $counter -ge 10 ]; then\n    break\n  fi\n  sleep 1\ndone\n```","commit_id":"b54a2be031464933c11c6abb201d609025ba4211"},{"author":{"_account_id":32553,"name":"Sven Kieske","email":"sven_oss@posteo.de","username":"skieske"},"change_message_id":"0fffadd3ffc46fa3b6a3cec81ded197729c0d673","unresolved":true,"context_lines":[{"line_number":193,"context_line":"    fi"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    openstack server resize confirm ${name}"},{"line_number":196,"context_line":"    sleep 10"},{"line_number":197,"context_line":"    # If the status is not ACTIVE, print info and exit 1"},{"line_number":198,"context_line":"    if [[ $(openstack server show ${name} -f value -c status) !\u003d \"ACTIVE\" ]]; then"},{"line_number":199,"context_line":"        echo \"FAILED: Instance is not active after resize confirm\""}],"source_content_type":"text/x-sh","patch_set":5,"id":"0da94d3b_d4d17079","line":196,"range":{"start_line":196,"start_character":0,"end_line":196,"end_character":2},"in_reply_to":"c3ebf8a9_91dd8bc2","updated":"2023-12-22 15:28:53.000000000","message":"to be clear: we really should only add timeouts and sleeps if they are absolutely necessary. Our CI runtime is already very very long so I think each added second needs a good justification.\n\nI didn\u0027t had a look at the pipeline yet, just at the code, so I assumed there must be a race condition or more time needed for CI to catch up, because you added the sleep.\n\nif this is not needed - it\u0027s not entirely clear to me from your comment - then we should of course avoid both a loop and the sleep, _if_ they are not necessary.","commit_id":"b54a2be031464933c11c6abb201d609025ba4211"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"bb37a25530162a23f10532f6321e738071e420ad","unresolved":false,"context_lines":[{"line_number":193,"context_line":"    fi"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    openstack server resize confirm ${name}"},{"line_number":196,"context_line":"    sleep 10"},{"line_number":197,"context_line":"    # If the status is not ACTIVE, print info and exit 1"},{"line_number":198,"context_line":"    if [[ $(openstack server show ${name} -f value -c status) !\u003d \"ACTIVE\" ]]; then"},{"line_number":199,"context_line":"        echo \"FAILED: Instance is not active after resize confirm\""}],"source_content_type":"text/x-sh","patch_set":5,"id":"94298e55_b4829e10","line":196,"range":{"start_line":196,"start_character":0,"end_line":196,"end_character":2},"in_reply_to":"cecd7838_aeb798a9","updated":"2024-01-05 15:50:22.000000000","message":"I had a syntax error in my bash code, fixed now.","commit_id":"b54a2be031464933c11c6abb201d609025ba4211"}]}
