Closed leonidas-o closed 3 years ago
Same here. I reverted back to 4.0.0
Yes, for now our recommendation is to pin Redis as .upToNextMinor(from: "4.0.0")
until we can properly get a fix out.
@leonidas-o or @pankajsoni19 could I ask you to try this using:
.package(url: "https://gitlab.com/vapor/redis.git", .branch("feature/eventloop-fix"))
I have moved out of the organization where I wrote the swift based server code. So objective was to attain stability in last deployment under me. I would not be able to give time to test this out.
@siemensikkema I guess you mean github.com/vapor/redis.git
and not gitlab...
? Okay, that looks good. At least all my routes are working now without throwing an error.
@leonidas-o haha, yeah how did I make that mistake? I blindly copy/pasted and adapted from another line... Great to hear that it's working! That should allow us to avoid reverting 4.1.0.
🙂 never mind and thanks for the fix. I guess this will be just the next tag after 4.1.0?
@leonidas-o yeah this has been released in 4.1.1
I've got a crash on boot when redis version > 4.0.0:
Fatal error: No redis found for id default, or the app may not have finished booting. Also, the eventLoop must be from Application's EventLoopGroup.: file Redis/RedisStorage.swift, line 51
But pinning to 4.0.0 helps:
.package(url: "https://github.com/vapor/redis.git", .exact("4.0.0"))
@HashedViking which version of Redis exactly is causing the crash?
@0xTim 4.2.0
boot.swift
public func boot(_ app: Application) throws {
let cachedPKsFuture = app.redis.get(RedisKey(FRK.firebasePKs),
asJSON: FirebasePublicKeys.self) // <<--- crash
// ...
}
On boot I try to fetch the data previously cached in Redis, with 4.0.0 this way was ok.
@HashedViking if you call app.boot()
before that does it work?
yeah, calling try? app.boot()
at the first line fixes the problem, is it intended behaviour?
Not intentionally but yes it's required because of the way Redis sets up its internal state
Describe the bug
After updating to 4.1.0 the following error is thrown as soon as I use my cacheRepo.
The execution gets stuck at:
Routes without cacheRepo usage, are not affected. Downgrading to redis 4.0.0 shows no errors and everything works as expected.
Inside
configure.swift
redis is setup using:RedisRepo contains just the requirements from the cacheRepo protocol:
CacheRepoFactory contains:
To Reproduce
First I encountered the error after
request.cacheRepo.get(...)
was used. But it actually happens on all repo methods. As soon as you try toreturn request.eventLoop...
Steps to reproduce the behavior:
req.eventLoop.
) will throw an errorExpected behavior
No error, same behaviour like in redis 4.0.0.
Environment