Skip to content

Reconnecting due to pool functionality #309

Description

@mattephi

As #308 mentioned, lines 512-534

async def get_connection(self, host, port, init_func=None):
self.register_host_port(host, port, init_func)
ret = None
for task in self.pools[(host, port, init_func)][::]:
if task.done():
if task.exception():
self.pools[(host, port, init_func)].remove(task)
continue
reader, writer, *other = task.result()
if writer.transport.is_closing():
self.pools[(host, port, init_func)].remove(task)
continue
if not ret:
self.pools[(host, port, init_func)].remove(task)
ret = (reader, writer, *other)
self.register_host_port(host, port, init_func)
if ret:
return ret
return await self.open_tg_connection(host, port, init_func)

cause the proxy user to reconnect several times. In particular, it cycles through reconnecting->updating->reconnecting->... until eventually getting connected after some time. However, I have only one proxy user and this behaviour seems to be wrong, as it takes a very long time to reconnect and fetch updates. Is there any meaningful fix to this part other than completely disabling this part of the code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions