Commit Graph

409 Commits

Author SHA1 Message Date
Rick Newton-Rogers e7e1061170 Follow-up cleanup of GitHub Actions migration (#116)
* Motivation:

Make use of more common GitHub Actions migration workflows and repository style changes.

Modifications:

* Unit tests workflows run redis in a separate services container to speed up unit tests
* Introduce `main.yml` which runs workflows on each commit to main and periodically to catch any regressions in merges or from upstream.
* Remove the docker files which are no longer used and contained outdated pipelines.
* Add Cxx interoperability checks

Result:

More in common with other GitHub Actions adoptions.

* disable strict concurrency
2024-11-22 09:22:48 +00:00
Konrad `ktoso` Malawski 2df32390e2 migrate to github actions (#112) 2024-11-08 14:09:10 +09:00
Yim Lee c8f217fb81 Add CI for Swift 5.10 (#103) 2024-02-07 12:33:59 +01:00
AntVil 622ce440f9 fix AsyncStream polyfill swift<5.9 (#101) 1.6.2 2023-12-11 08:24:04 -08:00
Fabian Fett a476f69cbb Add missing availibility flags (#99) 1.6.1 2023-11-15 11:26:46 +01:00
hamzahrmalik 5a81dd73c9 Improve error messages (#97) 1.6.0 2023-11-15 10:55:50 +01:00
Fabian Fett 4cd8a49da2 Remove jazzy from docker images (#98) 2023-11-15 10:27:05 +01:00
Tim Condon e243c4e26e Update README.md (#95)
Master branch is no more, rename to main
2023-10-06 03:35:52 -07:00
Fabian Fett 10c8c6b813 Add RedisClusterShardDescriptionProtocol (#93) 2023-09-20 22:29:32 +02:00
Fabian Fett f837e2929f Add DiscardingTaskGroup and Stream polyfills for cluster support (#94) 2023-09-19 21:16:16 +02:00
Fabian Fett 1b69101da1 Add RedisClusterNodeDescription and RedisClusterNodeID (#92) 2023-09-19 15:29:38 +02:00
Fabian Fett 41b77775e1 Add RedisHashSlot (#91) 2023-09-18 09:54:14 +02:00
Joannis Orlandos 9118427c1c Change the 'debug' log statement when a connection is grabbed from a connectionpool to 'trace' (#88) 2023-09-15 10:44:10 +02:00
Joannis Orlandos 26299c0571 Readme: Clarify how to obtain an EventLoop (#89)
Fixes a dead link to the EventLoop docs, and add a default way to obtain an EventLoop using NIOSingletons.
2023-09-14 18:02:37 +02:00
Fabian Fett 30a43b0195 Close connection pool even if some connections are leased/in creation (#86)
Currently closing a pool, that has leased connections or currently creates connections fails. Such a close attempt brings the pool in an unrecoverable closing state and may lead to crashes. This patch changes the pool shutdown behavior to allow closing the pool even if the pool is not a predefined state.
1.5.1
2023-08-04 16:06:16 +02:00
Fabian Fett 2d626c89d0 Cherry pick GitLab 187: Graceful connection close without sending QUIT command (#85)
Cherry pick: https://gitlab.com/swift-server-community/RediStack/-/merge_requests/187

> Note: Clients should not use this command. Instead, clients should simply close the connection when they're not used anymore. Terminating a connection on the client side is preferable, as it eliminates TIME_WAIT lingering sockets on the server side.

https://redis.io/commands/quit/
2023-08-04 11:54:52 +02:00
Fabian Fett 99cd4a4642 Mark RedisConnectionPool as final (#83) 2023-08-03 13:02:30 +02:00
Fabian Fett 43ea6af862 Make RedisConnection.Configuration.defaultPort thread safe (#81)
`RedisConnection.Configuration.defaultPort` is currently unprotected shared mutable state. To ensure thread safety this patch adds an atomic to back this property. Since setting the `defaultPort` doesn't make much sense for adopters, we deprecate the setter. Lastly we mark `RedisConnection.Configuration` as `Sendable`.
1.5.0
2023-07-08 14:58:55 +02:00
Fabian Fett 5c8a78885e Add release.yml for better generated release notes (#80) 2023-07-08 10:16:10 +02:00
Fabian Fett 97dc6dd15e Split up Configuration file into two: RedisConnectionPool & RedisConnection (#78) 2023-07-07 10:24:47 +02:00
Fabian Fett 8843065e6d Add NIOSSL dependency (#74)
We want to enable TLS Redis Connections out of the box. For this to work we need to link NIOSSL. This patch just adds the dependency. Most of our adopters have NIOSSL very likely in their dependency graph anyway.
2023-07-06 11:56:46 +02:00
Fabian Fett 95b2d06688 Move RESP3TokenDecoder into its own file (#75) 2023-07-06 02:28:26 -07:00
Fabian Fett ae9f06b503 Move ConnectionPool files into the ConnectionPool folder (#76)
Let's move files that are connected to ConnectionPool into the ConnectionPool folder. Also rename `ConnectionPoolErrors.swift` to `RedisConnectionPoolError.swift` to match the type that is defined within.
2023-07-06 11:24:45 +02:00
Joannis Orlandos 9225dc306c Introduces a RESP3Token wrapper struct around ByteBuffer (#71)
Co-authored-by: Fabian Fett <fabianfett@apple.com>
2023-07-05 17:51:14 +02:00
Fabian Fett 89a29d457c Add support for usernames (#72)
Redis 6.0 adds the ability to specify a username when sending an `AUTH` command. This patch adds this capability to RediStack.
2023-07-03 21:23:07 +02:00
Fabian Fett 3001e41ca6 Remove Context, use Logger everywhere instead (#70)
We have an internal `typealias Context = Logging.Logger`. This is quite confusing. Remove the typealias, use logger everywhere instead.
2023-07-03 12:12:45 +02:00
Fabian Fett 018a9b9626 Add RedisCommandEncoder (#69)
We want to be able to efficiently encode Redis commands that are sent to a server. This patch adds a new `RedisCommandEncoder` that allows us to efficiently create Redis commands without needing to go through RESP representations, that may require us to create Arrays. Further it introduces a `RESP3BlobStringEncodable` that must be implement to send blob strings using `RedisCommandEncoder`. This patch also adds implementations for `String` and  `ByteBuffer` for the new `RESP3BlobStringEncodable` protocol.
2023-07-03 10:28:39 +02:00
Fabian Fett d7c4121e4b README.md: Switch mirroring around (#56) 2023-06-20 13:33:15 +02:00
Joannis Orlandos 8128bafec2 Remove the gitlab CODEOWNERS file. Change the issue/PR templates to point to github (#67)
* Change the issue and merge templates for Gitlab, pointing to Github instead

* Remove codeowners file

* Deduplicate the issue templates
2023-06-20 11:15:10 +02:00
Fabian Fett ad54519476 Remove GitLab CI (#66)
As part of the repo move from GitLab to GitHub we now use the swift-server CI. For this reason we can remove the GitLab CI files.
2023-06-20 10:41:58 +02:00
Joannis Orlandos 95d04866ef README: Remove the testing table, release table and supported OSes (#62) 2023-06-19 05:49:51 -07:00
Fabian Fett 11b4673523 Conform RedisByteDecoder to NIOSingleStepByteToMessageDecoder (#63) 2023-06-19 10:52:59 +02:00
Fabian Fett ef5fdf7e63 Delay connection attempts without addresses. (#64)
In some circumstances users may have connection pools configured without
any SocketAddresses ready to go. This is particularly likely in service
discovery configurations. Right now, the effect of attempting to use
such a pool is two fold. First, we'll emit a bunch of error level logs
telling users we have no addresses. Second, we'll fall into the
exponential backoff phase of connection establishment.

The first property is annoying, but the second one is actively harmful.
If your construction is timed incorrectly, we'll have the awkward
problem of burning a bunch of CPU trying to create connections we know
we cannot, and then a lengthy delay after the addresses are actually
configured before we start trying to use them. That's the worst of all
worlds.

This patch adds logic to detect the attempt to create connections when
we don't have any configured addresses and delays them. This path should
improve performance and ergonomics when in this mode.

Authored-by: Cory Benfield <lukasa@apple.com>
2023-06-19 10:37:15 +02:00
Fabian Fett 5fadd5fe06 Require Swift 5.6 (#65) 2023-06-19 00:40:53 -07:00
Joannis Orlandos 2f3db6ef11 Remove reliance on the NIO umbrella module (#60) 2023-06-19 09:37:04 +02:00
Fabian Fett 60021f99bc Remove codeclimate (#55) 2023-06-16 11:11:58 -07:00
Fabian Fett 4bdcd203fc Remove github funding and issue and pr template (#53) 2023-06-16 20:01:56 +02:00
Fabian Fett a0e908845e Cherry pick: Explicitly depend on Atomics (#57) 2023-06-16 19:55:58 +02:00
Fabian Fett 10a5c3949e Add soundness and api breakage CI (#58) 2023-06-16 19:50:46 +02:00
Fabian Fett 35e0d67e84 Fix crash in tests: Use explicit RedisCommand instead of tuple (#52) 2023-06-16 19:15:42 +02:00
Fabian Fett a7d196e813 Add swift-server CI (#54) 2023-06-16 18:37:34 +02:00
Marius Seufzer 43d94452a8 call onUnexpectedConnectionClose on closeFuture 1.4.1 2023-06-13 11:34:05 +02:00
Marius Seufzer 2fd4db68e9 fix compiler error for pre 5.7 swift versions 2023-06-12 13:19:09 +02:00
Nathan Harris 0862006557 [Misc] Update contributors list 1.4.0 2023-06-10 09:44:14 -05:00
Marius Seufzer 5875335e08 Add onUnexpectedConnectionClose callback to pool
Backports `onUnexpectedConnectionClose` on the pool to 1.x
2023-06-09 18:58:21 +00:00
Gwynne Raskind 3bd5940b07 Make the parameter-less RedisClientError factory statics computed properties. As stored properties, they trigger Thread Sanitizer errors when multiple connections trigger the same errors (usually connectionClosed) too close together due to lazy once-only initialization. 1.3.3 2023-05-27 21:56:49 -05:00
Nathan Harris 254e3e78b3 Add support for Swift Package Index documentation hosting
This is a cherry-pick of commit 4e2217cffd
1.3.2
2023-01-19 22:40:08 -06:00
Nathan Harris 4ed1aa5596 [Misc] Update contributors 2022-12-12 21:32:30 -06:00
Fabian Fett c85f857554 Add support for graceful shutdown to the RedisCommandHandler 2022-12-07 17:15:42 +01:00
Nathan Harris b5c0bc8e05 Bump minimum supported Swift version to 5.5
## Motivation

RediStack 1.x is going to be supported at least until 2.x is released, which is a few months away.

Developers who are on later versions of Swift will adopt later versions of NIO and other libraries, and after we merged !183 we required NIO 2.42.x which has a minimum Swift version of 5.5

## Changes

This back ports the CI config from `master` into this branch, with updates to the README to reflect the changes
2022-11-30 21:35:43 -06:00