Releases: apple/servicetalk
0.42.4
0.41.15
Changes
This is a minor maintenance release appropriate for all ServiceTalk users that contains several bug fixes and improvements.
New features
Bug fixes
- 3ceaf2c -
CompositeCloseable
: prepend doesn't respect ordering (#2097) - facbef1 -
Content-Type
for Zipkin Protobuf should beapplication/x-protobuf
(#2101) - ccbe7f9 -
ConnectionFactory
-level filters can not migrate to new API of #1956 (#2089)
Improvements
- efbd267 - Validate HTTP header name matches the token format (#2103)
- a4dd491 - Make
HttpLifecycleObserverServiceFilter
constructor public (#2096)
Improvements for tests
Thank you
Every idea, review, and bug-report counts and so we thought it is worth mentioning those who helped in this area. Please report an unintended omission.
0.42.3
Changes
This is a minor maintenance release appropriate for all ServiceTalk users that contains several bug fixes and improvements. It contains all changes released in 0.41.15 plus the following:
New features
- bacb5ab - Add
Single.repeatWhen(BiIntFunction<T, Completable>)
(#2090) - 6471bdf - Add
PayloadSizeLimitingHttp[Requester|Service]Filter
(#2100)
Bug fixes
Improvements
- c730c0d - Always encode spans as list in
HttpReporter
(#2092) io.servicetalk.opentracing.zipkin.publisher.reporter.HttpReporter
used to report non-batched single span using an unspecified API. From the current release, even non-batched span is published using the endpoint accepting an array of spans with one item (refer to https://zipkin.io/zipkin-api/#/default/post_spans for HTTP API specification).- 2376910 - Increase log level when global resources are closed (#2105)
- 24c34c3 - Revert breaking changes for
TimeoutFromRequest
introduced in #1832 (#2094)
Improvements for tests
Documentation
- bf48490 - Update docs references to 0.41.14 and 0.42.2
- 6848b09 - Update Jersey Router documentation (#2059)
- 3720865 - Fix jackson-jersey references to deprecated classes (#2063)
- 4aa5287 - Add client
RetryingHttpRequesterFilter
example (#2095) - cfb5949 - Fix broken JAX-RS javadoc links (#2072)
Dependencies
- b46aaf7 - Upgrade to Mockito 4.3.1 (#2091)
- e350689 - Update grpc-java 1.42.1 -> 1.43.0 (used for compatibility testing) (#2027)
- f32b0ce - Use gRPC-Java BOM (#2084)
Thank you
Every idea, review, and bug-report counts and so we thought it is worth mentioning those who helped in this area. Please report an unintended omission.
0.42.2
Changes
This is a minor maintenance release appropriate for all ServiceTalk users that contains several bug fixes and improvements. It contains all changes released in 0.41.14 plus the following:
New features
- d31c0dc -
Publisher#multicast
option to not cancel upstream (#2065) - 5fe4903 - Implement
setClassLevel()
forExecutorExtension
(#2075)
Bug fixes
Improvements
- dd99c4f - Use
setClassLevel(true)
on static instances (#2068) - 886cbcd - Default
requiredOffloads
useinfluenceStrategy
(#2058)
Documentation
- 6848b09 - Update Jersey Router documentation (#2059)
- 3720865 - Fix jackson-jersey references to deprecated classes (#2063)
Thank you
Every idea, review, and bug-report counts and so we thought it is worth mentioning those who helped in this area. Please report an unintended omission.
0.41.14
Changes
This is a minor maintenance release appropriate for all ServiceTalk users that contains several bug fixes and improvements.
New features
- 20f62ae - HTTP
Expect: 100-continue
(#2037) (#2079)- See Expect: 100-continue section in docs.
- 155e924 -
IoExecutor
implementsconcurrent.Executor
(#2066) - 917791d - Add
awaitSubscribed()
to test async sources (#1661)
Bug fixes
- 9251d06 - Fix filters for
MultiAddressUrlHttpClientBuilder
(#2071) - 1f972d1 -
MultiAddressUrlHttpClient
should redirectPOST/PUT/PATCH/DELETE
by default (#2077)
Improvements
- 580a5a2 - Schedule/execute no offload timeouts on
IoExecutor
(#2070) - a556d22 - Update grpc example pom.xml (#2057)
- e33e1f4 -
NettyIoThread
should implementContextMapHolder
(#2083)
Documentation
Dependencies
- d86ab9a - Update Netty 4.1.73.Final -> 4.1.74.Final (#2080)
- 6fe9356 - Update netty-incubator-transport-native-io_uring 0.0.11 -> 0.0.12 (#2082)
- 9c84575 - Update slf4j 1.7.32 -> 1.7.36 (#2081)
Thank you
Every idea, review, and bug-report counts and so we thought it is worth mentioning those who helped in this area. Please report an unintended omission.
0.42.1
Changes
This is a minor maintenance release appropriate for all ServiceTalk users that contains several bug fixes and improvements. It contains all changes released in 0.41.13 plus the following:
New features
Improvements
Documentation
Dependencies
Thank you
Every idea, review, and bug-report counts and so we thought it is worth mentioning those who helped in this area. Please report an unintended omission.
0.41.13
Changes
This is a minor maintenance release appropriate for all ServiceTalk users that contains several bug fixes and improvements. It contains important bug fixes for retry logic configuration, upgrades netty to 4.1.73 which relaxes duplicated native library detection, protobuf to 3.19.2 which fixes a potential Denial of Service issue, log4j to 2.17.1 which fixes CVE-2021-44832.
New features
- 6df6952 - Make exception mapper filters public (#2050)
HttpExceptionMapperServiceFilter
andGrpcExceptionMapperServiceFilter
can be used at any position in the filter chain to mapThrowable
(s) into a properly formatted HTTP/gRPC response.
- 83d4b93 - Make
HttpLifecycleObserverServiceFilter
public (#2051)- In addition to
[Http|Grpc]ServerBuilder#lifecycleObserver(...)
method that captures entire state of the server processing chain, newHttpLifecycleObserverServiceFilter
allows users to place lifecycle observer at any other position in the filter chain or apply conditionally.
- In addition to
API deprecation
Developer note: Additional API deprecation advisories and guidance have been added in each of the 0.41.X releases. Please build your application with the latest 0.41.X release and carefully review the deprecation warnings reported and associated suggestions. Changes to applications may be required for compatibility with future versions of ServiceTalk beyond the API compatible 0.41.X series. While there are many deprecations for planned future API changes, most applications should require few changes as the most significant changes are to internal or specialized APIs. If you have concerns or expect problems related to any of the API deprecations please report these as an issue.
- 593d620 - Rename
subscribeShareContext()
toshareContextOnSubscribe()
(#1975)- Deprecated
subscribeShareContext()
operator inSingle
,Completable
, andPublisher
, introduceshareContextOnSubscribe()
as a replacement to clarify that this operator does not actually subscribes to the async source.
- Deprecated
Bug fixes
- c69078f - Prevent retry logic modifications through the builder (#2031)
- eb72c09 - Allow using pre-existing
AutoRetryStrategyProvider
andRetryingHttpRequesterFilter
together (#2042) - 6e3667f - Fix infinite retries under particular conditions (#2041) (#2049)
Improvements
- c444966 -
RoundRobinLoadBalancer
: maketargetResource
logging less confusing (#2044) - 22ae4cb - Add more logging for
GrpcRouter
and other transport classes (#2055)
Documentation
Dependencies
- 65fe5cb - Update netty 4.1.72 -> 4.1.73 (#2053)
- 6f90bf1 - Update log4j 2.16.0 -> 2.17.1 (#2043, #2045)
- fb74aa0 - Update protobuf 3.19.1 -> 3.19.2 (#2047)
- efe2d94 - Update proto-google-common-protos 2.7.0 -> 2.7.1 (#2048)
- b04b8ff - Update gradle shadow 7.0.0 -> 7.1.1 (#2026)
- 72ba992 - Update grpc-java 1.42.1 -> 1.43.0 (used for compatibility testing) (#2027)
Thank you
Every idea, review, and bug-report counts and so we thought it is worth mentioning those who helped in this area. Please report an unintended omission.
- @Abdelrahman-IK
- @bondolo
- @chemicL
- @idelpivnitskiy
- @Scottmitch
- @tkountis
0.42.0
Overview
This is a major ServiceTalk feature release appropriate for all users containing numerous new features and many improvements. We are actively working towards ServiceTalk 1.0 and this intermediate release helps us to refine and stabilize the API. Existing ServiceTalk applications will need to be recompiled to use the 0.42 release and will likely require some code changes or migration to the new API. Also, make sure all other libraries or extensions that depends on the ServiceTalk API in your classpath are also recompiled with 0.42.
Changes
The 0.42.0 release includes significant new features and API changes but incorporates as closely as possible the same dependencies and bug fixes as the prior 0.41.12 release.
Offloading Changes
In addition to the API changes, ServiceTalk 0.42 includes some significant behavioral differences that may impact existing applications. Offloading, the execution of user code on non-I/O threads, is one area that has changed significantly. In ServiceTalk 0.41 and earlier the strategy used for offloading was applied more generally than in 0.42. This meant that most user code, even code which did not expect to be offloaded, was offloaded from I/O threads. This approach had the advantages of consistency and safety; the execution environment for user code was predictable and the Netty I/O threads were protected from being unavailable while executing application code.
In ServiceTalk 0.42 the offloading strategy is more focused and offloading is done in fewer situations, primarily only those situations which explicitly require offloading. Offloading is an expensive activity. If the application or ServiceTalk logic which needs to be executed is insignificant or carefully bounded and never blocks then avoiding offloading has a positive impact on both latency and throughput. Offloading is controlled by the use of the publishOn
and subscribeOn
offloading operators and for filters and services by implementing the StrategyInfluencer
interface.
Executors and other operators
In prior versions of ServiceTalk all operators could access the most recently referenced Executor
in the operator pipeline. In 0.42 the intended executor for executing the operations pipeline is only exposed to offloading operators. Other operators are effectively “immediate” meaning that they expect to run on whatever thread is active when they are invoked, the timeout
and liftAsync
operators are affected.
Retrying / Auto-Retrying filters
RetryingHttpRequesterFilter & Auto-Retrying filters/API were unified in a new RetryingHttpRequesterFilter
now available under io.servicetalk.http.netty
package. The new filter offers support for handling lower level transport errors and retrying them (ie. what Auto-Retry was offering before) as well as allowing users to define their own retry rules per request/response basis.
RetryingHttpRequesterFilter
offers fine grain control over retry behavior, here are some highlights:
retryRetryableExceptions
Supports retry behavior forRetryableException
which are transport layer errors that occur inside ST and signal erroneous behavior before a request touches the “wire”. By default this is enabled and behaves the same way Auto-Retry was before.retryIdempotentRequests
Supports retry behavior for requests that are marked as idempotent when an I/O exception occurs.retryDelayedRetries
Supports retry behavior for errors that are type ofDelayedRetry
a marker interface that holds additional backoff time info, to be evaluated when the total back-off time is computed. One possible situation that this can be useful is if users want to translate aRetry-After
header in a response, and allow the retry-filter to wait for that amount of time (ie. retry-after period) before retrying.responseMapper
&retryResponses
Supports mapping any response to anHttpResponseException
giving the ability to users to retry particular responses according to their own criteria. First you map the response to an error withresponseMapper
then you define the retry behavior throughretryResponses
.
All above flavors offer fine control over the retry behavior of each retry criterion, e.g retry up-to 5 times retryable exceptions, and up-to 2 times delayed retries with max-delay of 2 seconds. On top of that, users can define a max-total
retry count, that can be used to exit the retry logic if the cumulative amount of retries (of all retry configurations) reaches that count.
The RetryingHttpRequesterFilter
is by default enabled and added as the last filter in the filter chain, similarly to how auto-retry behaved before, only retrying RetryableException
s, however if users define their own version of that and apply it in a particular placement in their filter chain, then this order/configuration takes precedence over the default behavior.
This work was ignited as an effort to minimize the places users have to define retry logic, and avoid situations where these placements conflict with each other resulting in retry logic that wasn’t expected.
Serialization
Interfaces from the io.servicetalk.serialization.api package have been deprecated (SerializationProvider
, ..). The deprecated interfaces have been replaced with new interfaces in io.servicetalk.serializer.api. The new APIs apply lessons learned from usage of deprecated APIs and here are some highlights:
- Composition between scalar serializers in streaming use cases. Streaming serializers provide reusable framing (Length Delimited VarInt/Fixed, gRPC) across different serialization technologies (Protobuf, thrift, ..).
- Encapsulation of serialization allows exposing streaming building blocks while hiding custom framing (gRPC SerializerDescriptor).
- Streaming APIs leverage Reactive Streams lifecycle and primitives instead of custom APIs and lifecycle.
- Support for JDK primitive types such as byte[] and String. See how these utilities are composed/leveraged in HttpSerializers.
Checkout the http serialization examples to see the new APIs in action. Javadocs on each deprecated type include @deprecated
notices referencing the replacement classes, and here is a summary of commonly used types:
- HttpSerializationProviders → HttpSerializers
- JacksonSerializationProvider → JacksonSerializerFactory
- ProtobufSerializationProvider → ProtobufSerializerFactory
Builders
General
- All builders (client & server, HTTP & gRPC) have been changed from abstract classes to interfaces to allows users wrap them to enhance/modify behavior. Method names didn’t change. HTTP users should not notice this change as soon as they recompile with 0.42, gRPC users may need to migrate their HTTP-specific configuration to
HttpInitializer
API (see #1867 and #1861). Resolving all deprecations highlighted building for 0.41.12 will make this transition smooth when upgrading to 0.42. - All one-way builder methods, like
HttpServerBuilder.disableDrainingRequestPayloadBody()
, have been changed to take aboolean
argument to allow ...
0.41.12
Changes
This is a minor maintenance release appropriate for all ServiceTalk users that contains several bug fixes and improvements.
New features
- cc61daa - Add support for io_uring (#1971)
- io_uring is a new asynchronous I/O API for Linux that provides significant performance improvements for I/O operations. The minimal Linux kernel requirement is 5.10. Users need to set
-Dio.servicetalk.transport.netty.tryIoUring=true
to activate this feature.
- io_uring is a new asynchronous I/O API for Linux that provides significant performance improvements for I/O operations. The minimal Linux kernel requirement is 5.10. Users need to set
- 13dce91 - Let users opt-in for app initialization failures without native libs (#2006)
- Use
-Dio.servicetalk.transport.netty.requireNativeLibs=true
to fail ServiceTalk to start without native transport (epoll/kqueue). Without this system property, netty will fallback to Java NIO. However, Java NIO has limitations which may cause unexpected behavior and increased number of failed requests. For example, it does not proactively notify when a remote peer closes connections. As the result, a new request have to be attempted to observe that connection was closed leading to a request error.
- Use
- ad81b3f - Adjusting
ServiceDiscovererEvent
contract (#1906)ServiceDiscovererEvent
now hasstatus()
method instead ofisAvailable()
boolean flag;
- 93a98af -
Completable#concat(Completable...)
(#1945) - cfe7007 - Add context associated with an HTTP request or response (#1904)
- As an alternative to
AsyncContext
, each HTTP request and response has acontext()
method that holds a state during request-response exchange. It's more lightweight and always is associated with a request or response, regardless of asynchronous boundaries or transitioning from async to blocking API.
- As an alternative to
API deprecation
Developer note: Additional API deprecation advisories and guidance have been added in each of the 0.41.X releases. Please build your application with the latest 0.41.X release and carefully review the deprecation warnings reported and associated suggestions. Changes to applications may be required for compatibility with future versions of ServiceTalk beyond the API compatible 0.41.X series. While there are many deprecations for planned future API changes, most applications should require few changes as the most significant changes are to internal or specialized APIs. If you have concerns or expect problems related to any of the API deprecations please report these as an issue.
- 3c2d0e2 - Remove
HttpExecutionStrategy
from requester and reserveConnection API (#1956)- Users should update their filters to override another
request
orreserveConnection
methods that do not takeHttpExecutionStrategy
as an argument. If modifications for theHttpExecutionStrategy
are required, useHttpContextKeys#HTTP_EXECUTION_STRATEGY_KEY
;
- Users should update their filters to override another
- ebe2911 - Deprecate
ServiceDiscoveryRetryStrategy
(#1931)- Deprecated
ServiceDiscoveryRetryStrategy
andDefaultServiceDiscoveryRetryStrategy
; - Deprecated
PartitionedHttpClientBuilder#retryServiceDiscoveryErrors(ServiceDiscoveryRetryStrategy)
and introduced a variant acceptingBiIntFunction<Throwable, ? extends Completable>
; - Deprecated
SingleAddressHttpClientBuilder#retryServiceDiscoveryErrors(ServiceDiscoveryRetryStrategy)
and introduced a variant acceptingBiIntFunction<Throwable, ? extends Completable>
.
- Deprecated
- 9c66e41 - Deprecate and replace
noOffloadsStrategy()
(#1989)noOffloadsStrategy()
is deprecated and the more descriptiveoffloadNever()
is introduced to replace it.
- 0d70851 - Unified retry / auto-retry filter support (#2020)
- A new variant of
RetryingHttpRequesterFilter
was introduced inio.servicetalk.http.netty
package; io.servicetalk.http.utils.RetryingHttpRequesterFilter
andAutoRetryStrategyProvider
are deprecated and their logic in consolidated inio.servicetalk.http.netty.RetryingHttpRequesterFilter
;
- A new variant of
- 34f726e - Migrate
AsyncContext
toContextMap
API (#1910)- API modifications:
- Deprecate
AsyncContextMap
in favor ofContextMap
API; - Deprecate
AsyncContextMapHolder
in favor ofContextMapHolder
; AsyncContext
: deprecate all methods that referenceAsyncContextMap
and add new static methods that targetContextMap
API;- Add temporarily method
AsyncContext.newKeyMapping
to allow mappingAsyncContextMap.Key
<->ContextMap.Key
to let users use old/new API in the same codebase; IoThreadFactory.IoThread
extends deprecatedAsyncContextMapHolder
, consider migrating toNettyIoExecutors
static factories that do not require anIoThreadFactory
. If your codebase implementsIoThreadFactory
, make sure it also implementsContextMapHolder
;BasicAuthHttpServiceFilter
: deprecateuserInfoKey(AsyncContextMap.Key)
in favor ofuserInfoAsyncContextKey(ContextMap.Key)
anduserInfoRequestContextKey(ContextMap.Key)
;BasicAuthSecurityContextFilters
: deprecateforGlobalBinding(AsyncContextMap.Key)
in favor offorGlobalBinding(ContextMap.Key)
andforNameBinding(AsyncContextMap.Key)
in favor offorNameBinding(ContextMap.Key)
;
- Deprecate
- Behavior changes:
AsyncContext.put(...)
andAsyncContext.putAll(...)
don't throwUnsupportedOperationException
whenAsyncContext
is disabled;- Default implementation of
AsyncContext
more strictly validatesnull
keys.null
keys were never allowed, but pre-existing behavior throws NPE onAsyncContext.get(key)
instead ofAsyncContext.put(null, value)
;
- API modifications:
Improvements
- 1fecc6b -
Read/WriteObserver
: give users visibility into items (#2013) - c0c2c83 -
TransportObserver#onNewConnection
give visibility into addresses (#2012) - e7a287b - Provide more context when native transport is unavailable (#1978)
- 1d3ba69 - Give visibility to the assigned HTTP/2 Stream ID (#1969)
- 81c81c9 -
MessageEncodingException
should take an encoding name only (#1940) - 3358e01 - Implement
toString()
for ourThreadFactory
variants (#1939) - cc4d56f - Correctly report TLS handshake when TCP Fast Open is enabled (#1970)
Bug Fixes
- 582259a - Reduce
SSLSession
cache misses (#1958) (#1966) - 80435d7 -
DefaultCompositeCloseable
StackOverflowException (#1946) - c08a411 -
HttpLoadBalancerFactory
should overridenewLoadBalancer
with 3 args (#1935)
Documentation
- 5055942 - Improve BlockingIterable javadoc (#2010)
- f07e708 - Clarify
ServiceDiscovererEvent
contract related to address and status (#1963)
Dependencies
This release upgrades Netty to 4.1.72 which contains an important fix for CVE-2021-43797 and Log4J to 2.16.0 which contains fixes for CVE-2021-44228 and CVE-2021-45046.
- 51092e7 - Upgrade Log4J 2.15.0 → 2.16.0 (#2022)
- 1161335 - Update Netty 4.1.70 -> 4.1.72 (#2016)
- 8445446 - Update log4j 2.14.1 -> 2.15.0 (#2007)
- 26c79f7 - Update protobuf-gradle-plugin 0.8.17 -> 0.8.18 (#1995)
- 69870ab - Update proto-google-common-protos 2.5.1 -> 2.7.0 (#1994)
- e6ea2c6 - Update grpc-java 1.41.0 -> 1.42.1 (#1993)
- 0d5dc7e - Update protobuf 3.18.1 -> 3.19.1 (#1992)
- 78d156c - Update junit 5.8.1 -> 5.8.2, junit-platform 1.8.0 -> 1.8.2 (#1991)
- 6f50031 - Update build to Gradle 7.3 (#1950)
Thank you
Every idea, review, and bug-report counts and so we thought it is worth mentioning those who helped in this area. Please report an unintended omission.
0.41.11
Changes
This is a minor maintenance release appropriate for all ServiceTalk users that contains several bug fixes and improvements.
Bug fixes
- 378a61c -
RoundRobinLoadBalancer
: use anExecutor
with unbounded queue by default for health checks (#1937)
Improvements
- f09799b -
RoundRobinLoadBalancer
: reduce number of operators in health check chain (#1938) - 95c6bdd -
RoundRobinLoadBalancerFactory
flipeagerConnectionShutdown
tofalse
by default (#1934) - 934b7ba -
SingleThreadedScheduler
should fallback execution upon offloading failure and give visibility for unexpected exceptions fromoffloadExecutor
(#1936)
Thank you
Every idea, review, and bug-report counts and so we thought it is worth mentioning those who helped in this area. Please report an unintended omission.