Skip to content

Commit 433d7ff

Browse files
committed
Improve comments
Signed-off-by: Matt Lord <mattalord@gmail.com>
1 parent 9fb48f7 commit 433d7ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

go/vt/vtctl/workflow/traffic_switcher.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,10 +1147,11 @@ func (ts *trafficSwitcher) cancelMigration(ctx context.Context, sm *StreamMigrat
11471147
}
11481148

11491149
// We create a new context while canceling the migration, so that we are independent of the original
1150-
// context being cancelled prior to or during the cancel operation.
1151-
// Create a child context that cannot be canceled by the parent, so that we maintain the locks.
1150+
// context being canceled prior to or during the cancel operation itself.
1151+
// First we create a copy of the parent context, so that we maintain the locks, but which cannot be
1152+
// canceled by the parent context.
11521153
cctx := context.WithoutCancel(ctx)
1153-
// Now create a child context from that which has a timeout.
1154+
// Now we create a child context from that which has a timeout.
11541155
cmTimeout := 60 * time.Second
11551156
cmCtx, cmCancel := context.WithTimeout(cctx, cmTimeout)
11561157
defer cmCancel()

0 commit comments

Comments
 (0)