| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…on was raised for the session and create new session if needed
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM 👍 One minor suggestion for another test case
Sorry, something went wrong.
… unrelated to Sessions
| Back | FazBrowse Home | New Git URL |
PingingPool currently checks if session exists in .get() method only when _NOW() > ping_after. If the session is used in any query and then returned the pool then the ping_after is reset to _NOW() _ + delta. If the session is deleted in the backend and the checkout gives a not found error the session will still get returned to the pool with a reset for ping_after = _NOW() _ + delta.
As described in the comment in get() method.
Example:
An Application using PingingPool with 1 Session. The session has been killed on the server side, but the ping method has not cleared out the session from the pool yet because ping_after > _NOW() is not True.
Now pool.get() will return the session, and SnapshotCheckout will use the session and fail and return the session back into the pool.
Put Method will put the session in the pool with a new wait_time, and the process will continue.
To avoid this inside the __exit__ method of SessionCheckout we should check if NOT_FOUND error was raised or not. If that error was raised then create a new session and push it inside the pool.