m-barthelemy / vapor-queues-fluent-driver

A Fluent implementation for https://github.com/vapor/queues (Vapor4)
MIT License
32 stars 16 forks source link

Should the driver be shutting down the event loop group? #19

Open tonyarnold opened 2 years ago

tonyarnold commented 2 years ago

https://github.com/m-barthelemy/vapor-queues-fluent-driver/blob/882718f877d27ff4760e84f89ec1c06920135776/Sources/QueuesFluentDriver/FluentQueuesDriver.swift#L51-L52

I'm seeing some problems in my tests that go away if I disable my app's queues, and they're all related to the Queues package trying to access PostgreSQL after they are supposed to (during/after application shutdown).

Should the driver be shutting down the event loop group that it owns during the lifecycle method here?

m-barthelemy commented 2 years ago

Hi Tony,

Initially that's what I was doing but it was causing some issues, see https://github.com/m-barthelemy/vapor-queues-fluent-driver/pull/11

I'm really not sure what needs to be done; if you have any advice please do share!

tonyarnold commented 2 years ago

I really don't have any advice, sorry!

I was seeing the Jobs table being accessed after I'd initiated shutdown of the app, so something isn't right, but I can't be sure that it's specific to this package, or the parent queues package.

In any case, switching to the in-memory test queue provider fixed the issue for me (and is probably more reasonable to use when testing).