Tags: scor2k/go-vector-logger
Tags
feat: Implement TCP connection idle timeout (#12) * feat: Implement TCP connection idle timeout This commit introduces an idle timeout for TCP connections in the VectorLogger. Connections will now automatically close after one minute of inactivity. Changes include: - Added `lastActivityTime`, `TimeoutDuration`, `mu`, `stopChan`, and `wg` fields to `VectorLogger`. - Modified `New()` to initialize these fields and launch a proactive connection management goroutine. - Updated `send()` to check for idle connections before sending, re-establish if necessary, and update `lastActivityTime`. - The proactive goroutine (`manageConnection`) periodically checks for idle connections and closes them. - `Close()` method now gracefully stops the `manageConnection` goroutine using a channel and `sync.WaitGroup`, and ensures thread-safe connection closing. - Added unit tests in `logger_test.go` to verify: - Connection timeout and automatic reconnection. - Frequent logging keeps the connection alive. - `Close()` method correctly stops the background goroutine and closes the connection. - The `TimeoutDuration` field is exported to allow tests to set shorter timeout values. * docs: add changelog for version 0.8.0 - Add comprehensive release notes for v0.8.0 - Document new TCP connection idle timeout management - List improvements in connection handling and error recovery - Include new testing infrastructure and example application - Note breaking changes and bug fixes from v0.7.0 * feat: 0.8.0 version --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
fix: re-write the code to handle persistent connections (#10) * feat: remove deprecation part * feat: add test app and bash script to start vector * chore: update readme and go.mod to handle local run * fix: revert all changes with buffers to fix the lib * chore: improve error messages * feat: add persist connection * feat: add re-connect