This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Open
Conversation
* group together fixtures for backend testing
* Add per-backend setup to allow slow initialization.
This is specially important as kafka subscribe can return while the consumer
is not ready. See related test setup upstream:
- https://github.com/aio-libs/aiokafka/blob/2c54e10c57760f779961a8c2f5df8ad609ef6983/tests/test_consumer.py#L433
- https://github.com/aio-libs/aiokafka/blob/2c54e10c57760f779961a8c2f5df8ad609ef6983/tests/_testutil.py#L376
- https://github.com/aio-libs/aiokafka/blob/2c54e10c57760f779961a8c2f5df8ad609ef6983/tests/_testutil.py#L364
fixes encode#42
Signed-off-by: Pablo Woolvett <pablowoolvett@gmail.com>
broadcaster/_backends/postgres.py
Outdated
|
|
||
| async def connect(self) -> None: | ||
| self._conn = await asyncpg.connect(self._url) | ||
| self._event = asyncio.Event() |
There was a problem hiding this comment.
Wouldn't it be simpler to use asyncio.Lock?
Contributor
Author
There was a problem hiding this comment.
Simpler, and better.
This fix adds an asyncio.Lock to avoid `asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress` fixes encode#22
|
recently, my project facing some issue seems like this PR doesn't resolve slow backend initialization issue |
|
Why didn't this merge? If I fixed its conflicts, would it be accepted? |
Contributor
|
@logankaser let's have it split into multiple PRs. I believe there is only one issue related to postgres left. |
|
I think there are two:
|
Contributor
|
#66 looks like a good merge candidate, but I did not test it yet. |
|
Any update on this issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test: add concurrent checks
This is specially important as kafka subscribe can return while the consumer
is not ready. See related test setup upstream:
chore: update remnants, packages
fix(backend/kafka): consumer unsubscribe not awaitable
fix(backend/postgres): allow concurrent pubs
This fix adds a lock (asyncio.Event based) to avoid
asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progressfixes #22
fixes #42