Skip to contentSkip to conversation

cs-adjust-flight: Work properly on db transaction retry

PATCH In review Ian Jackson 2 participants 2 messages Mar 20, 2017 – Mar 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cs-adjust-flight: Work properly on db transaction retry

The variable @changes is eaten during processing. So on db retry, there would be changes missing. (When creating a new flight, this would often mean a flight with no jobs, which cannot be executed.)

CC Roger Pau Monné <[email protected]>
---
 cs-adjust-flight |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
cs-adjust-flight +4 -1
index 85ced59..b78ea7e 100755
@@ -85,9 +85,10 @@ while (@ARGV && $ARGV[0] =~ m/^\-/) {
 }
 
 die unless @ARGV >= 1;
-our ($dstflightspec,@changes) = @ARGV;
+our ($dstflightspec,@org_changes) = @ARGV;
 
 our $dstflight;
+our @changes;
 
 sub spec_re ($) {
     my ($spec) = @_;
@@ -463,6 +464,8 @@ sub changes () {
 	die "$dstflight already has steps\n".Dumper($step) if $step;
     }
 
+    @changes = @org_changes;
+
     while (@changes) {
         my $change = shift @changes;
         $change =~ s/-/_/g;
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ian Jackson

The variable @changes is eaten during processing. So on db retry, there would be changes missing. (When creating a new flight, this would often mean a flight with no jobs, which cannot be executed.)

CC Roger Pau Monné <[email protected]>

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel