During an upgrade, multiple patch directories may
be detected, and the patch controller may attempt to
iterate over those folders to determine the packages.
The code that iterates over those folder can raise
RuntimeError: dictionary changed size during iteration
if the directory does not exist, but a package does.
The fix is to iterate over the copy of the list.
This issue only occurs in a duplex env, when the neighbor
sync is being done. It will be encountered when a patch
import is invoked after the older directory is removed.
Test Plan:
AIO-DX create multiple folders under /var/www/pages/feed
and trigger a patch-import
Closes-Bug: #2017916
Signed-off-by: Al Bailey <email address hidden>
Change-Id: Ic78d30019bdaa93b9493bf57c7122f6de7cc6dab
Reviewed: https:/ /review. opendev. org/c/starlingx /update/ +/881741 /opendev. org/starlingx/ update/ commit/ 4624457333733ed 38012af8bf4abe4 46bddc1f04
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 4624457333733ed 38012af8bf4abe4 46bddc1f04
Author: Al Bailey <email address hidden>
Date: Thu Apr 27 14:58:05 2023 +0000
Fix runtime patching error during upgrade
During an upgrade, multiple patch directories may
be detected, and the patch controller may attempt to
iterate over those folders to determine the packages.
The code that iterates over those folder can raise
RuntimeError: dictionary changed size during iteration
if the directory does not exist, but a package does.
The fix is to iterate over the copy of the list.
This issue only occurs in a duplex env, when the neighbor
sync is being done. It will be encountered when a patch
import is invoked after the older directory is removed.
Test Plan:
AIO-DX create multiple folders under /var/www/pages/feed
and trigger a patch-import
Closes-Bug: #2017916 3b9493bf57c7122 f6de7cc6dab
Signed-off-by: Al Bailey <email address hidden>
Change-Id: Ic78d30019bdaa9