v0.1.4
Changes in this milestone (v0.1.x)
This is the latest release of the v0.1.x milestone that significantly contributed to the overall stability of GatewayD. A lot of changes has gone into this milestone including the following:
- Fixed concurrent connection handling and management.
- Changed parameter type of
HookConfig.Run
to receivemap[string]interface{}
and convert it tostructpb.Struct
internally to remove lots of boilerplate code. - Improved error handling by wrapping/unwrapping package-level errors into
GatewayDError
with lots of custom errors for different parts of the system. - Added more tests.
- Improved client code by introducing chunk reading of the buffer to prevent hanging and introduction of deadlines (timeouts).
- Added mechanism to retry the connection after close by the server.
- Used structured logging everywhere.
- Added comments to code and docstrings to all functions.
- Improved traffic hooks by removing a lot of duplicate code and cleanups.
- Added TCP Keep-Alive to client connections.
- Partially fixed stale connection issues until the issue I investigated is resolved, as quoted below:
PostgreSQL has an authentication timeout of 60s that waits till the client authenticates. The current design of GatewayD makes the TCP connection and waits for the connecting clients of GatewayD to authenticate via the proxied connection to PostgreSQL. This causes connections to become stale over time due to timeout. I need to start developing PostgreSQL-specific features for authentication and other related components, either with the plugins or the core.
Changes in the current release
In this release, I've tried to improve the code as best as I can. The connection stability is greatly improved, however the connections will somehow time out and become stale, although new connections will help re-instantiate the client object, which fixes the problem, but this is not enough. My fixes in this release help detect the issue earlier and close the ingress connection abruptly, which is not what I intend to do. The other change is improvements to hook system by addressing a few edge cases. I also added a TCP keepalive to the client connections.
What's Changed
- Traffic hooks improvements by @mostafa in #64
- Add TCP keepalive by @mostafa in #68
- Fix stale connection issue by @mostafa in #69
Full Changelog: v0.1.3...v0.1.4