summaryrefslogtreecommitdiff
path: root/internal/clients
AgeCommit message (Collapse)Author
2026-04-10Fix known-hosts trust deadlock, host key stat, and optional nozstd buildPaul Buetow
- stdout logger: release mutex while waiting on pause resume so prompt callbacks can log (fixes hang after trusting new hosts; known_hosts was written but Resume never ran). - known hosts callback: stop borrowing the SSH dial throttle channel (could block or interact badly with parallel handshakes). - host key path: use errors.Is(..., fs.ErrNotExist) for RootedPath.Stat wrapped errors; stat errors now fail fast instead of mis-read. - public key path: same ErrNotExist check for authorized_keys miss. - Build: optional DTAIL_NO_ZSTD=yes / nozstd tag for CGO-free builds; split zstd readers into tagged files. - Docs/examples: firewalld note for port 2222, log prune timer+script, SSHBindAddress note, dserver unit disabled-by-default comment; firewalld helper script example. - Regression test for stdout pause/mutex behavior. Made-with: Cursor
2026-03-20Optimize mapr parsing and stabilize aggregate shutdownPaul Buetow
2026-03-19task 213: harden interactive query session transitionsPaul Buetow
2026-03-13Fix serverless output draining regressionsPaul Buetow
2026-03-13Expand runtime query unit test coveragePaul Buetow
2026-03-13task be5429a7: cover reconnect session restorePaul Buetow
2026-03-13task 57753d28: add interactive query controlPaul Buetow
2026-03-13task 4abe7505: reset dmap generation statePaul Buetow
2026-03-13task 407: add client session transportPaul Buetow
2026-03-13task 399: add capability fallback helperPaul Buetow
2026-03-13task 400: add server session command scaffoldingPaul Buetow
2026-03-13task 399: add client session spec scaffoldingPaul Buetow
2026-03-10Introduce client runtime boundariesPaul Buetow
2026-03-10Refactor server-side config singleton readsPaul Buetow
2026-03-08task: replace looped time.After with tickers (task 378)Paul Buetow
2026-03-08task: scope auth key dependencies to server instances (task 375)Paul Buetow
2026-03-04fix: avoid defer-in-loop cancel in base client retry (task 359)Paul Buetow
2026-03-03Add auth-key fast reconnect integration coveragePaul Buetow
2026-03-03feat(config): add auth-key CLI and server cache settingsPaul Buetow
2026-03-03feat(client): register AUTHKEY after SSH session startPaul Buetow
2026-03-02config: make server timing and buffer knobs configurablePaul Buetow
2026-03-02clients: add jittered exponential reconnect backoffPaul Buetow
2026-03-02mapr client: replace runtime panics with errorsPaul Buetow
Task: 4e6d7744-3f5c-4880-9e5d-368ece96470d
2026-03-02Refactor server path to use injected runtime config (task 329)Paul Buetow
2026-02-15refactor: implement context-aware network dialingPaul Buetow
Modernize network dialing to use Go's context-aware patterns for better cancellation support and connection reliability. Changes: - Update Go version from 1.24 to 1.25 in go.mod - Replace ssh.Dial with net.Dialer.DialContext + ssh.NewClientConn for SSH client connections in serverconnection.go - Add TCP KeepAlive (30s) for SSH connection health monitoring - Implement context-aware dialing for SSH agent connections in ssh.go - Improve error messages to distinguish dial vs SSH handshake failures - Update AGENTS.md with integration test requirements Benefits: - Context cancellation now properly affects connection establishment - TCP KeepAlive prevents silent connection failures - Better integration with Go's cancellation patterns - Improved reliability for distributed systems All integration tests pass with race detection enabled. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03Add SSH agent key selection and fix MapReduce outfile handlingPaul Buetow
This commit adds two major features and fixes: 1. SSH Agent Key Selection: - Add --agentKeyIndex flag to select specific SSH agent key (0-based) - Solves "too many authentication failures" with multiple SSH keys - Default -1 uses all keys (backwards compatible) - Available in dtail, dcat, dgrep, dmap commands 2. MapReduce Outfile Fixes: - CSV files now written at every interval, not just on exit - Proper signal handling (SIGTERM/SIGINT) with graceful shutdown - 5-second grace period for cleanup before force exit - Fixes issue where outfile remained as .tmp during execution Usage: dtail --servers host --agentKeyIndex 0 --query '...' outfile results.csv This is particularly useful with YubiKey/hardware tokens where many keys are loaded in the SSH agent, and for monitoring MapReduce results in real-time as they're computed. Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-29refactor: improve Go best practices compliancePaul Buetow
- Add explicit interface satisfaction checks (var _ Interface = (*Type)(nil)) for compile-time verification: - TurboWriter implementations (DirectTurboWriter, TurboChannelWriter) - Processor implementations (GrepLineProcessor, ChannellessLineProcessor) - Parser implementations (genericParser, csvParser, genericKVParser, custom parsers, mimecastParser) - Logger implementations (file, stdout) - Handler implementations (ServerHandler, ClientHandler) - Connector implementations (Serverless, ServerConnection) - SSH callback implementations (KnownHostsCallback) - Improve error handling with context wrapping (%w): - SSH operations: GeneratePrivateRSAKey, Agent - Query parsing: Query.parse - SSH client connections: dial, session, handle methods - Fix receiver consistency: - Convert Query.String() from value to pointer receiver - Convert Outfile.String() from value to pointer receiver - Convert all KnownHostsCallback methods to pointer receivers - Convert mapCommand.Start() to pointer receiver - Reorganize file structure for better clarity: - internal/io/dlog/dlog.go: Move type definition before public functions - internal/mapr/token.go: Reorganize helper functions after public ones - Add documentation comments: - Query.String() method - Outfile.String() method - Regex.String() method - Improve config variable documentation All unit tests and integration tests pass. Amp-Thread-ID: https://ampcode.com/threads/T-019c0b08-0eeb-705d-a1f7-31bb764b659a Co-authored-by: Amp <amp@ampcode.com>
2025-07-04fix: remove unnecessary delays in turbo mode for serverless operationPaul Buetow
In serverless mode (when dcat runs locally), data is written directly to stdout and doesn't need network transmission delays. This fix eliminates the 500ms+ exit delay by skipping unnecessary sleep calls when running in serverless mode. Changes: - Skip 500ms wait in readFiles() when serverless - Skip 50ms wait in readWithTurboProcessor() when serverless - Skip aggregate serialization waits when serverless - Fix turbo benchmark test compilation errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04fix: resolve MapReduce turbo mode issues and serverless processingPaul Buetow
- Fix serverless MapReduce to pass options with map command for proper mode detection - Prevent raw lines from being sent to client during MapReduce operations - Only use turbo mode for cat/grep/tail when no aggregate is present - Fix race conditions in TurboAggregate with proper synchronization - Add SafeAggregateSet wrapper for thread-safe operations - Fix parser selection to use correct parser names - Add comprehensive unit tests for turbo aggregate functionality This ensures MapReduce operations in both turbo and non-turbo modes produce identical results and fixes serverless mode processing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-29fix: resolve dcat test failures with channel-less implementationPaul Buetow
- Fix serverless mode extra blank lines by removing DTail 3 backward compatibility fallthrough for '\n' character - Fix empty line handling in client message processing - Update integration test framework to inherit environment variables, allowing turbo boost testing - Clean up debug logging code Note: dcat1d.txt test fails because DTail adds newline to files without trailing newlines - this is a protocol limitation where newlines are stripped during transmission and re-added by the client. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-28feat: implement channel-less grep for 62% performance improvementPaul Buetow
- Add LineProcessor interface for direct line processing without channels - Implement channel-less file reading in readfile_processor.go - Add optimized reader with 256KB buffering for efficient I/O - Create GrepLineProcessor for direct writing without intermediate channels - Fix serverless mode hanging due to stdin pipe detection - Fix base64 decoding bug (was counting characters instead of arguments) - Fix message output formatting by adding proper newline handling Performance improvements: - Channel-based: 9.00s → Channel-less: 3.42s (62% faster on 100MB files) - Removed channel synchronization overhead and context switching - Reduced memory allocations with buffer pooling Environment variables: - DTAIL_CHANNELLESS_GREP=yes - Enable channel-less implementation - DTAIL_OPTIMIZED_READER=yes - Use optimized buffered reader Known limitation: Inverted grep with context (--invert with --before/--after) not fully implemented in channel-less mode. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-26fix: resolve package conflicts and update documentationPaul Buetow
- Move main package files to benchmarks/cmd/ to fix test failures - Update CLAUDE.md with comprehensive benchmarking and profiling instructions - Fix unused imports in serverless.go - Remove experimental buffered pipe/copy implementations - Remove outdated documentation files All integration tests now pass successfully. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-26fix: resolve serverless mode deadlock for profilingPaul Buetow
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>
2024-03-29only rename .csv.tmp to .csv when the final result was writtenPaul Buetow
2024-03-29lint warningsPaul Buetow
2023-06-21DTail: Restrict SSH MAC algorithms allowed - Update of few dependenciesPaul Buetow
2022-07-15Fix typos.Paul Buetow
2022-02-15add missing newlines to server messages when running mapreduce queries tooPaul Buetow
2022-02-14hotfixing dtail health checkPaul Buetow
2021-11-07can set ssh private key path file via env varPaul Buetow
2021-11-04Correct mapr stdout newlinesPaul Buetow
2021-11-02Make it so that DTail 3 incompatibility error is printed when trying to ↵Paul Buetow
connect to it via a DTail client 4.x
2021-11-02Bugfix: Dealing correctly with files without newline characters, also add ↵Paul Buetow
more tests
2021-10-27Fix --shutdownAfter client switchPaul Buetow
2021-10-27integration tests use separate ssh private key filePaul Buetow
2021-10-24Fix deadlock around aggregating data + server max concurrent file read limiterPaul Buetow
2021-10-21merge developPaul Buetow
2021-10-21backport mapreduce reporter rampup from masterPaul Buetow
2021-10-19Bugfix: Use correct hostname when no port specifiedPaul Buetow
2021-10-11add dtail integration testPaul Buetow