Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ linters:
- { disabled: true, name: max-public-structs }
- { disabled: true, name: nested-structs }
- { disabled: true, name: package-comments }
- { disabled: true, name: redefines-builtin-id }
- { disabled: true, name: unchecked-type-assertion }
- { disabled: true, name: unexported-naming }
- { disabled: true, name: unexported-return }
Expand All @@ -136,3 +135,7 @@ linters:

run:
go: 1.24.7

issues:
max-issues-per-linter: 50
max-same-issues: 50
6 changes: 3 additions & 3 deletions packages/docker-reverse-proxy/internal/utils/string.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package utils

func SubstringMax(s string, max int) string {
if len(s) <= max {
func SubstringMax(s string, maxLen int) string {
if len(s) <= maxLen {
return s
}
return s[:max] + "..."
return s[:maxLen] + "..."
}
8 changes: 0 additions & 8 deletions packages/orchestrator/internal/sandbox/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ func NewFile(
}
}

func min(a, b int64) int64 {
if a < b {
return a
}

return b
}

func (b *File) ReadAt(ctx context.Context, p []byte, off int64) (n int, err error) {
for n < len(p) {
mappedOffset, mappedLength, buildID, err := b.header.GetShiftedMapping(off + int64(n))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ func NewUffdioRegister(start, length, mode CULong) UffdioRegister {
}
}

func NewUffdioCopy(b []byte, address CULong, pagesize CULong, mode CULong, copy CLong) UffdioCopy {
func NewUffdioCopy(b []byte, address CULong, pagesize CULong, mode CULong, bytesCopied CLong) UffdioCopy {
return UffdioCopy{
src: CULong(uintptr(unsafe.Pointer(&b[0]))),
dst: address &^ (pagesize - 1),
len: pagesize,
mode: mode,
copy: copy,
copy: bytesCopied,
}
}

Expand Down
8 changes: 4 additions & 4 deletions packages/shared/pkg/storage/gcp_multipart.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ func createRetryableClient(config RetryConfig) *retryablehttp.Client {
client.RetryWaitMax = config.MaxBackoff

// Custom backoff function with full jitter to avoid thundering herd
client.Backoff = func(min, max time.Duration, attemptNum int, resp *http.Response) time.Duration {
client.Backoff = func(start, maxBackoff time.Duration, attemptNum int, resp *http.Response) time.Duration {
// Calculate exponential backoff
backoff := min
backoff := start
for range attemptNum {
backoff = time.Duration(float64(backoff) * config.BackoffMultiplier)
if backoff > max {
backoff = max
if backoff > maxBackoff {
backoff = maxBackoff
break
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/shared/pkg/storage/gcp_multipart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ func TestMultipartUploader_HighConcurrency_StressTest(t *testing.T) {

// Update max concurrent parts
for {
max := atomic.LoadInt32(&maxConcurrentParts)
if current <= max || atomic.CompareAndSwapInt32(&maxConcurrentParts, max, current) {
maxConcurrent := atomic.LoadInt32(&maxConcurrentParts)
if current <= maxConcurrent || atomic.CompareAndSwapInt32(&maxConcurrentParts, maxConcurrent, current) {
break
}
}
Expand Down Expand Up @@ -564,8 +564,8 @@ func TestMultipartUploader_ResourceExhaustion_TooManyConcurrentUploads(t *testin

// Track max observed concurrency
for {
max := atomic.LoadInt32(&maxObservedConcurrency)
if current <= max || atomic.CompareAndSwapInt32(&maxObservedConcurrency, max, current) {
maxObserved := atomic.LoadInt32(&maxObservedConcurrency)
if current <= maxObserved || atomic.CompareAndSwapInt32(&maxObservedConcurrency, maxObserved, current) {
break
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/pkg/storage/storage_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ func (c *CachedFileObjectProvider) readAndCacheFullRemoteFile(ctx context.Contex
return int64(written), err
}

func cleanup(msg string, close func() error) {
if err := close(); err != nil {
func cleanup(msg string, fn func() error) {
if err := fn(); err != nil {
zap.L().Warn(msg, zap.Error(err))
}
}
Expand Down