Skip to content

Conversation

@miparnisari
Copy link
Contributor

Before:

$ go run ./cmd/zed/main.go import /Users/miparnisari/Documents/GitHub/spicedb/development/schema.yaml
4:31PM WRN not calling a released version of SpiceDB version=db5a5cf56d43-dirty
4:31PM INF importing schema
4:31PM INF importing relationships batch_size=1000 count=10000 workers=1
4:31PM ERR terminated with errors error="failed to acquire semaphore for batch number 1: context canceled"
exit status 1

After:

$ go run ./cmd/zed/main.go import /Users/miparnisari/Documents/GitHub/spicedb/development/schema.yaml                 
4:31PM WRN not calling a released version of SpiceDB version=db5a5cf56d43-dirty
4:31PM INF importing schema
4:31PM INF importing relationships batch_size=1000 count=10000 workers=1
4:31PM ERR terminated with errors error="rpc error: code = InvalidArgument desc = update count of 1000 is greater than maximum allowed of 500"
exit status 1

for i := 0; i < numBatches; i++ {
if err := sem.Acquire(ctx, 1); err != nil {
return fmt.Errorf("failed to acquire semaphore for batch number %d: %w", i, err)
break
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI sem.Acquire only returns error on context canceled. if that happens, it's probably because one of the batches failed. if so, we need to wait for the g.Wait down below

@miparnisari miparnisari changed the title fix: #599, also surface errors if they occur fix: zed import (#599), also surface errors if they occur Dec 20, 2025
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@miparnisari miparnisari enabled auto-merge (squash) December 20, 2025 00:36
@miparnisari miparnisari merged commit 851fe17 into main Dec 20, 2025
12 checks passed
@miparnisari miparnisari deleted the fix-backup-import branch December 20, 2025 00:37
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.85%. Comparing base (7ed5ab0) to head (27bbd34).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #605      +/-   ##
==========================================
+ Coverage   39.28%   41.85%   +2.57%     
==========================================
  Files          37       37              
  Lines        5448     4774     -674     
==========================================
- Hits         2140     1998     -142     
+ Misses       3063     2522     -541     
- Partials      245      254       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants