Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PingingPool and TransactionPingingPool implementation does not match documentation #60

@larkee

Description

@larkee

There is a major bug in the ping() function used by both of these pools. The function breaks out of the while True: loop when the pool is empty or a session does not need to be pinged yet. This means it is unsuitable for use as a background thread as we suggest because the loop is likely to end the first time it is run.

Additionally, TransactionPingingPool puts used sessions into a pending sessions queue so they can have transactions started on them. However the begin_pending_transactions() function that removes them only runs once when the pool is created and once when the pool is bound to a database. The condition for the function loops is:
while not self._pending_session.empty():
which means if at any point there are no pending sessions, then any future pending sessions will not be refreshed. There is no documentation suggesting the a user needs to run this themselves which means this is another major bug.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner API.priority: p0Highest priority. Critical issue. P0 implies highest priority.type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions