laskoviymishka commented on code in PR #912:
URL: https://github.com/apache/iceberg-go/pull/912#discussion_r3103531353


##########
table/table.go:
##########
@@ -303,10 +326,55 @@ func (t Table) AllManifests(ctx context.Context) 
iter.Seq2[iceberg.ManifestFile,
 }
 
 func (t Table) doCommit(ctx context.Context, updates []Update, reqs 
[]Requirement) (*Table, error) {
-       newMeta, newLoc, err := t.cat.CommitTable(ctx, t.identifier, reqs, 
updates)
+       cfg := readRetryConfig(t.metadata.Properties())
+
+       // Bound total retry time with a derived context so both the wait loop
+       // and the CommitTable call itself respect the deadline uniformly.
+       retryCtx, cancel := context.WithTimeout(ctx, 
time.Duration(cfg.totalTimeoutMs)*time.Millisecond)
+       defer cancel()
+
+       var (
+               newMeta Metadata
+               newLoc  string
+               err     error
+       )
+
+       for attempt := 0; attempt <= cfg.numRetries; attempt++ {

Review Comment:
   yeah, iterating directly over `cfg.numRetries` would change the semantics 
(`numRetries=4` → 4 attempts instead of 5); Java's `commit.retry.num-retries` 
counts retries, not total attempts, so I added +1.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to