Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove placeholders from connection when done #540

Merged
merged 6 commits into from
May 18, 2022

Conversation

G1gg1L3s
Copy link
Contributor

This PR solves interference problem of placeholders. They are saved in the connection, but were never removed, only replaced. That means, they could affect other queries on the same connection.

Solve this, by removing the placeholders at the end of the query: when ReadyForQuery arrives.

I didn't write a new test for this, because 1) it already existed as a part of another test and 2) it's really hard to reproduce.

Checklist

The name will be reused later.
After the encoding error the Acra crafts and sends `Error` and
`ReadyForQuery` packets and starts skipping until database sends
`ReadyForQuery`. The latter is also skipped. This means that the Acra
doesn't proceeds ReadyForQuery in every execution path.

Change it to explicitly proceed `ReadyForQuery` from database, which
will trigger cleanup of the state.
#
# row = await conn.fetchrow(select_query, data['id'])
# self.assertEqual(data['value_bytes'], row['value_bytes'])
await conn.execute(insert_query, data['id'], data['value_bytes'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool)

@G1gg1L3s G1gg1L3s merged commit f2213b1 into master May 18, 2022
@G1gg1L3s G1gg1L3s deleted the G1gg1L3s/T2572-remove-placeholders-when-done branch May 18, 2022 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants