vapor / redis

Vapor provider for RediStack
MIT License
458 stars 57 forks source link

Random Server Crashes, 4.1.0 #181

Closed pankajsoni19 closed 3 years ago

pankajsoni19 commented 3 years ago

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
pankajsoni19 commented 3 years ago

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

pankajsoni19 commented 3 years ago

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.

pankajsoni19 commented 3 years ago

duplicate of #180.