Changelog for the gruf gem. This includes internal history before the gem was made.
- [#208] Fix rails
clear_active_connections!
deprecation warning
- [#190] Remove unsued
e2mmap
andthwait
gems fromruntime_dependency
. - [#194] Add interceptor to reload Rails app code accross requests
- [#209] Removes manual
establish_connection
and active connection check for each request fromGruf::Interceptors::ActiveRecord::ConnectionReset
.
- [#197] Add support for Ruby 3.3
- Drop support for Ruby 2.x
- Add
GRUF_USE_DEFAULT_INTERCEPTORS
ENV to dynamically enable/disable default interceptors - Allow passing of request object directly into
call
- [#179] Add Ruby 3.2 support
- [#178] Introduce read-write lock for code reloading; cover controller class resolution with code reloading.
- [#180] Support multiple databases connection reset in
Gruf::Interceptors::ActiveRecord::ConnectionReset
.
- [#175] Fix code reload thread-safety. Calls to
Zeitwerk::Loader#setup
are now made in a thread-safe manner.
- Fix issue where default gRPC health check was loaded even if unused or not desired; now only loaded when requested
- Add opt-in ability to serve the official gRPC health check
automatically via
health_check_enabled
configuration option (orGRUF_HEALTH_CHECK_ENABLED
environment variable). - Add
health_check_hook
configuration option to implement a custom response for the above gRPC built-in health check - [#156] Allow passing a specific list of services to run via the gruf binstub
- [#163] Add
context
hash attribute toGruf::Controllers::Request
to allow interceptors to pass information down to a gruf controller - Drop Ruby 2.6 support (EOL'ed on March 31st, 2022)
- Fix issue where GRPC_SERVER_POOL_KEEP_ALIVE and GRPC_SERVER_POLL_PERIOD when set via ENV are not cast to int
- NOTE: This changes the way that gruf controllers are autoloaded. See [UPGRADING.md] for more details.
- Autoload Gruf Controllers with zeitwerk, allowing for code reloading in development environments
- Add
GRUF_CONTROLLERS_PATH
ENV to allow ENV-based runtime configuration of path to gruf controller files - Move
ServiceBinder
from instance to static class for performance improvements - Use zeitwerk for autoloading
- Update gem metadata
- Update
Gruf:Configuration#environment
to useENV.fetch
- Fix issue where the server object hits thread contention in certain race conditions
- Set default client host to 0.0.0.0:9001 (same as default server host)
- Add support for Ruby 3.1
- Fix issue with race condition in server starts where servers may fail to bind connections and never reach serving state (fixes #147)
- Remove server mutex handling in deference to core grpc signal handling
- Relax grpc pin as upstream regression is fixed
- Fixed interceptor order to be FIFO as documented, instead of FILO (fixes #139)
- Restrict grpc gem to <= 1.41.0 due to regressions in grpc 1.42.x
- Fallback to stdout logger at INFO if no logger is setup
- Better handling of namespace collisions with Rails
- Add
GRPC_SERVER_HOST
andGRPC_SERVER_PORT
for ENV configuration of the server host+port - Add
GRPC_BACKTRACE_ON_ERROR
as available ENV configuration - Add default ENV-based configuration of the GRPC server pool
GRPC_SERVER_POOL_SIZE
- sets the size of the GRPC server poolGRPC_SERVER_POOL_KEEP_ALIVE
- keep alive time for threads spawned by the server poolGRPC_SERVER_POLL_PERIOD
- period in seconds to poll for workers in the gRPC server pool
- Improve Yardoc support across the library
- Added attribute-based documentation for Gruf configuration options
- Add mfa required for gemspec metadata
- Drop support for Ruby 2.4/2.5 to align with Ruby EOL schedule, supporting 2.6+ only
- Allow for float/TimeSpec timeout values on clients
- Allow for float/TimeSpec timeout values on clients (backport from 2.10.0)
- Change to racially neutral terminology across library
- blacklist->blocklist
- master->main branch
- Explicitly declare development dependencies in gemspec
- Add script/e2e test for full e2e test in regression suite
- Explicitly declare json gem dependency
- Update to Rubocop 1.4, add in rubocop-rspec for spec tests
- Add Ruby 2.7, 3.0 support
- Fix issue with --suppress-default-interceptors not working [#95]
- Loosen rake development dependency to >= 10.0 [#97]
- Pass the controller request object into the request logging formatters [#92]
- Add
channel_credentials
option toGruf::Client
anddefault_channel_credentials
option toGruf::Configuration
[#85] [#87]
- Add hook support for executing code paths before a server is started, and after a server stops
- Add frozen_string_literal: true to files, update rubocop to 0.68
- Drop Ruby 2.2 support
- Abstract gruf controller's send to make it usable in filters
- Adjusts configuration reset into a Railtie for Rails systems to ensure proper OOE
- Bump rubocop to 0.64, address violations, update activesupport/concurrent-ruby dependencies to have a min version
- Log ok/validation responses at DEBUG levels to prevent log stampeding in high-volume environments
- Ensure
timeout
is an int when passed as a client option to a gRPC client - Add
bound_service
reader toGruf::Controllers::Base
for finding the service bound to the given controller
- Client exceptions raised now contain mapped subclasses, such as
Gruf::Client::Errors::InvalidArgument
- Client exceptions will also now catch StandardError and GRPC::Core errors, and handle them as Internal errors
- Added SynchronizedClient which prevents multiple calls to the same endpoint with the same params at
a given time. This is useful for mitigating thundering herds. To skip this behavior for certain endpoints,
pass the
options[:unsynchronized_methods]
param with a list of method names (as symbols).
- Added error handling for GRPC::Core::CallError, a low-level error in the grpc library that does not inherit from StandardError. [#59]
- Removed
Thread.abort\_on\_exception = true
. Exceptions should be handled by gruf or the application, and should not cause the server process to crash. [#59] - Added guard for size of trailing metadata attached to grpc call. The default max for http2 trailing metadata in the gRPC C library is 8kb. If we go over that limit (either through custom metadata attached to the error by the application, or via the error payload encoded by the error serializer), the gRPC library will throw RESOURCE_EXHAUSTED. Gruf now detects this case, and attempts to prevent it by logging the original error and substituting it with an internal error indicating that the metadata was too large. [#60]
- Truncate stack trace in error payload to help avoid overflowing the trailing metadata. Added backtrace_limit configuration parameter, which defaults to 10.[#60]
- Safer configuration of GRPC::RpcServer. From now on, use
Gruf.rpc_server_options
for the params to be sent to GPRC::RpcServer. Also provide sane defaults for params for GRPC::RpcServer. [#55] - Added ability to monitor
RESOURCE_EXHAUSTED
andUNIMPLEMENTED
. By settingevent_listener_proc
in the Gruf configuration, you will receive a callback when these events occur. The parameter to your callback will be a symbol (:thread_pool_exhausted
or:unimplemented
). Others may be added in the future.
- Added a hash of error log levels to RequestLogging interceptor, mapping error code to level of logging to use. To override the level of logging per error response, provide a map of codes to log level in options, key :log_levels. The default is :error log level.
- Add Gruf::Interceptors::ClientInterceptor for intercepting outbound client calls
- Add command-line arguments to the gruf binstub
- Add ability to specify server hostname via CLI argument
- Add ignore_methods option for RequestLogging interceptor [#45]
- Now changes proc title once server is ready to process incoming requests [#44]
- Gruf now requires gRPC 1.10.x+ due to various fixes and improvements in the gRPC core libraries
- Run server in a monitored thread to allow for trapped exits on sigints [#43]
- Add ability to pass in client stub options into Gruf::Client
- Add ability to list, clear, insert before, insert after, and remove to a server's interceptor registry
- Ensure interceptors and services cannot be adjusted on the server after it starts to prevent threading issues
- [#36], [#37] Adds
response_class
,request_class
, andservice
accessors to controller request
- Fix regression [#35] where gruf was not able to be loaded outside of a Rails application
- Update Rubocop to 0.51
- Fix issue [#32] where server was not handling signals (\ht @Parad0X)
- Handle ActiveRecord connection management more gracefully (Fixes #30)
Gruf 2.0 is a major shift from Gruf 1.0. See UPGRADING.md for details.
- New thread-safe controller-based model
- New controller request object
- Hooks deprecated in favor of interceptors
- New interceptor timer utility class
- Default logging to logstash formatter
- Various Gruf::Server improvements
- Fix issues where field errors were persisted in between separate calls
- Fix issues with arity and bidirectional streaming
- Fix reference issue for client and bidirectional streaming calls
- Loosen explicit Protobuf dependency now that 3.4.0.2 is released
- Guard against nil params in logger blocklist
- Support nested blocklist parameters in path.to.key format
- Pin Google Protobuf to 3.3.x due to failures in protobuf in Ruby at 3.4.x
- Added ability to pass in server options via new
server_options
configuration attribute. (\ht @kruczjak)
- Instrumentation hooks now execute similarly to outer_around hooks; they can now instrument failures
- Instrumentation hooks now pass a
RequestContext
object that contains information about the incoming request, instead of relying on instance variables - StatsD hook now sends success/failure metrics for endpoints
- Add ability to turn off sending exception message on uncaught exception.
- Add configuration to set the error message when an uncaught exception is handled by gruf.
- Add a request logging hook for Rails-style request logging, with optional parameter logging, blocklists, and formatter support
- Optimizations around Symbol casting within service calls
- Add the ability for call options to the client, which enables deadline setting
- Bump gRPC to 1.4
- Added rubocop style-guide checks
- Updated license to MIT
- Send gRPC status 16 (Unauthenticated) instead of 7 (PermissionDenied) when authentication fails
- Move to gRPC 1.3.4
- Add outer_around hook for wrapping the entire call chain
- Add ability to specify a separate gRPC logger from the Gruf logger
- Add ability to run multiple around hooks
- Fix bug with error handling that caused error messages to repeat across streams
- Fix issue with around hook
- Add catchall rescue handler to capture uncaught exceptions and raise a GRPC::Internal error.
- Add Gruf.backtrace_on_error configuration value. If set, Gruf will call Service.set_debug_info with the exception backtrace if an uncaught exception occurs.
- Pass the service instance into hooks for reference
- Ensure timer is measuring in milliseconds
- Fix issue with interceptor and call signature
- Add instrumentation layer and ability to register new instrumentors
- Add out-of-the-box statsd instrumentation support
- Rename Gruf::Endpoint to Gruf::Service
- Make services auto-mount to server upon declaration
- Support mount command on services to allow automatic setup on the server
- Cleanup and consolidate binstub to prevent need for custom binstub per-app
- Relax licensing to a clean BSD license
- Initial public release