goharbor / acceleration-service

Provides a general service to support image acceleration based on kinds of accelerator like Nydus and eStargz etc.
Apache License 2.0
77 stars 27 forks source link

feat: resolve error in highly concurrent by singleflight #143

Closed Desiki-high closed 1 year ago

Desiki-high commented 1 year ago

When acceld handles highly concurrent conversion tasks, the content store will be locked because of fetching the same layer.

Changes:

  1. Add singleflight in LocalAdapter.Dispatch. If the image ref is the same, we only convert once simultaneously.
  2. Add singleflight in fetchHandler. If the desc.Digest is the same, we only fetch once simultaneously.

Github Action:

In Integration Test, we can move accel check out of build, it will make ci faster.

resolve #46.

Desiki-high commented 1 year ago

@imeoer All fixed. PTAL.