Skip to content
Discussion options

You must be logged in to vote

I reviewed your code. There is one critical bug and several secondary issues preventing multi-server connections from working. Here is the diagnosis with fixes.

Critical bug: self.session is overwritten on every server connection

In client.py, connect_to_servers iterates through server configs and calls connect_to_streamable_http_server for each one. But every call overwrites self.session:

# current code — BROKEN
for config in server_configs:
    if await self.connect_to_streamable_http_server(server_name, server_url, headers):
        successful_connections += 1

Inside connect_to_streamable_http_server:

self.session: ClientSession = await self._session_context.__aenter__()

Only the last …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SivaShankar-Innocito
Comment options

Answer selected by SivaShankar-Innocito
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants