vapor/redis

Random Server Crashes, 4.1.0

pankajsoni19 opened this issue · 3 comments

I updated swift dependencies. And now I am getting this on server start

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

forcing eventloop group will cause a major re-write for me in massive codebase. is there some alternative

In last couple of days, my server environment has gotten very unstable. With random crashes throughout.
I think I have zeroed in on the issue.

in same query if I access redis and mysql, eventloop's get messed up and server crashes. as an example.

this sort of pattern is present mostly in code. check cache, miss -> checkdb -> update cache -> result -> crash

func status(_ req: Request) throws -> Future<Status> {
     return User.query(on: req.db).group(.or) {
            $0.filter(\.$id == login.user).filter(\.$email == login.user)
        }
        .first()
        .flatMap {
           // update redis ->
        }
        .transform to result
}

I reverted to 4.0.0. Whatever changes you guys have done, need testing.

duplicate of #180.