Skip to content

Infinite loop of retries when connection fails #6

@qboot

Description

@qboot

Hello!
First, thanks for your work with Thruway. 🙏

I'm trying to use a Thruway\Connection which uses internally Thruway\Transport\PawlTransportProvider and Thruway\Peer\Client.

Everything works as expected when I pass a "valid" $options array :

$connection = new Connection([
    'realm' => $realm,
    'authid' => $token,
    'url' => $url,
    'authmethods' => ['jwt'],
    'onChallenge' => function () {
        return 'challenge-message';
    },
]);

But what if for example $token contains an invalid token?

The Client onOpen() function looks like:

public function onOpen(TransportInterface $transport) {
    $this->retryTimer    = 0; // ?
    $this->retryAttempts = 0; // ?
    $this->transport     = $transport;
    $session             = new ClientSession($transport, $this);
    $this->session       = $session;
    $session->setLoop($this->getLoop());
    $session->setState(ClientSession::STATE_DOWN);
    $this->startSession($session);
}

My question is: Why re-set retryTimer and retryAttempts here?
In my case it causes an infinite loop of retries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions