diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-26 18:11:21 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-26 18:11:21 +0300 |
| commit | 73ca612de9289a7362993099e3de720dbbf21519 (patch) | |
| tree | ac8776914f239ff83166083dd378f3af6d5484d0 /benchmarks | |
| parent | 0688866f81266a75c30411089cabb3896f4068bd (diff) | |
fix: resolve serverless mode deadlock for profiling
Implement channel-based bidirectional copying in serverless connector
to prevent deadlocks that occur with io.Copy when processing large files.
Changes:
- Replace direct io.Copy with channel-based approach in serverless.go
- Add bufferedpipe and bufferedcopy utilities (for future use)
- Add tests to verify deadlock prevention
- Fix dmap profiling example to use absolute paths
The fix successfully handles files up to ~10KB in serverless mode.
Larger files still experience issues and will be addressed in a
follow-up fix.
Fixes profiling hang issue when using -cfg none without servers.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'benchmarks')
| -rw-r--r-- | benchmarks/profile_example.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/benchmarks/profile_example.go b/benchmarks/profile_example.go index d187a5a..8d3ffcb 100644 --- a/benchmarks/profile_example.go +++ b/benchmarks/profile_example.go @@ -142,11 +142,18 @@ func profileDGrep(testFile string) { } func profileDMap(csvFile string) { + // Get absolute path for the CSV file + absPath, err := filepath.Abs(csvFile) + if err != nil { + fmt.Printf("Error getting absolute path: %v\n", err) + return + } + // Run dmap with profiling queries := []string{ - fmt.Sprintf("select count(*) from %s", csvFile), - fmt.Sprintf("select user, count(*) from %s group by user", csvFile), - fmt.Sprintf("select action, avg(duration), max(duration) from %s group by action", csvFile), + fmt.Sprintf("select count(*) from %s", absPath), + fmt.Sprintf("select user, count(*) from %s group by user", absPath), + fmt.Sprintf("select action, avg(duration), max(duration) from %s group by action", absPath), } for i, query := range queries { |
