Fix for cleverswarm backend #125

Merged
hurui200320 merged 10 commits from fix/channel-invalid-state into develop 2026-02-02 10:50:41 +00:00
Member

This PR contains a temporary fix for the cleverswarm:

  • (frontend) Test if the method result is coroutine (return value of async def) or not, only await if it's coroutine
  • (backend) Raise ConsumerChannelBrokenError when backend queue iter exits, HOWEVER, when channel fails, other aio-pika exception might get raised, not strictly this
  • (backend) Removed the timeout parameter for amq_service.data_message_generator
  • Remove connection in AMQ Message
  • RoutingService uses its own channel. TODO: how to detect and report this channel failure?
  • data_message_generator use its own channel.
  • Remove reinitialize_if_disconnected in amq service, the reinitializing process is not complete, it can't fix the problem at all.
  • release 0.3.3
This PR contains a temporary fix for the cleverswarm: + (frontend) Test if the method result is coroutine (return value of `async def`) or not, only await if it's coroutine + (backend) Raise `ConsumerChannelBrokenError` when backend queue iter exits, **HOWEVER, when channel fails, other aio-pika exception might get raised, not strictly this** + (backend) Removed the timeout parameter for `amq_service.data_message_generator` + Remove connection in AMQ Message + RoutingService uses its own channel. TODO: how to detect and report this channel failure? + `data_message_generator` use its own channel. + Remove `reinitialize_if_disconnected` in amq service, the reinitializing process is not complete, it can't fix the problem at all. + release 0.3.3
since nobody use it and it doesn't make any sense
Always close connection so we don't leak other channels
This method cause resource leak, doesn't call close/cleanup on the discarded object, and new object will not be picked up by some part of the program. This will only cause more issue than it's trying to fix
fix: allocate dedicated channel for data message generator
All checks were successful
/ run-unit-tests (push) Successful in 1m44s
/ build-and-push-otdemo (push) Successful in 3m38s
/ run-integration-tests-cleverswarm (push) Successful in 10m14s
/ run-internal-integration-tests (push) Successful in 17m6s
/ publish-python-library (push) Successful in 39s
51d037feb8
This is specifically for cleverswarm backend (and otdemo backend) who need a data message generator.

This change doesn't affect the normal HTTP request handling.
fix: allocate dedicated channel for routing service
All checks were successful
/ run-unit-tests (push) Successful in 47s
/ build-and-push-otdemo (push) Successful in 50s
/ run-integration-tests-cleverswarm (push) Successful in 10m32s
/ run-internal-integration-tests (push) Successful in 17m41s
/ publish-python-library (push) Successful in 37s
6726b516cb
feat: raise error when data message generator failed
All checks were successful
/ run-unit-tests (push) Successful in 46s
/ build-and-push-otdemo (push) Successful in 44s
/ run-integration-tests-cleverswarm (push) Successful in 10m32s
/ run-internal-integration-tests (push) Successful in 18m56s
/ publish-python-library (push) Successful in 45s
b8e8b549ac
fix: add fallback error raise statement for backend usage
All checks were successful
/ run-unit-tests (push) Successful in 47s
/ build-and-push-otdemo (push) Successful in 44s
/ run-integration-tests-cleverswarm (push) Successful in 10m18s
/ run-internal-integration-tests (push) Successful in 18m28s
/ publish-python-library (push) Successful in 39s
7bac57f590
ci: use latest cleverswarm lite as test
All checks were successful
/ run-unit-tests (push) Successful in 49s
/ build-and-push-otdemo (push) Successful in 14s
/ run-integration-tests-cleverswarm (push) Successful in 9m58s
/ run-internal-integration-tests (push) Successful in 17m49s
/ publish-python-library (push) Successful in 38s
90bcdbbef9
CoreRasurae left a comment
Member

I left one comment for the future, but the PR is approved.

I left one comment for the future, but the PR is approved.
@ -244,0 +223,4 @@
# So error on another channel won't break the request processing loop
async with self.rabbit_mq_client.connection.channel() as channel:
# Eventloop is single thread, process only 1 message at a time
await channel.set_qos(prefetch_count=1)
Member

For CleverSwarm we only process one message at a time, but there may be other clients later on that might be able to process more than one request.

For CleverSwarm we only process one message at a time, but there may be other clients later on that might be able to process more than one request.
hurui200320 deleted branch fix/channel-invalid-state 2026-02-02 10:50:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#124 Fix RabbitMQ channel dies silently
clevermicro/amq-adapter-python
You do not have permission to read 1 dependency
Reference
clevermicro/amq-adapter-python!125
No description provided.