hsluoyz commented on PR #82:
URL: 
https://github.com/apache/casbin-mongodb-adapter/pull/82#issuecomment-6637097565

   Thanks for finding this, the issue is real: `NewAdapterByDB` should never 
disconnect a client it didn't create.
   
   Fixed in 857d4ee with a smaller change: `NewAdapterByDB` no longer registers 
the finalizer, so the caller always owns the supplied client. Constructors that 
create their own client keep the finalizer, and now also disconnect that client 
if index creation fails during construction.
   
   We'd rather not add an `OwnsClient` option, since handing a shared client to 
a GC finalizer isn't something we want to encourage. The runner change doesn't 
help either: `ubuntu-latest` already resolves to `ubuntu-24.04`, and CI still 
fails while starting MongoDB. We'll fix that separately.
   
   Closing in favor of 857d4ee.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to