Skip to content

TimeoutError: timed out #231

Closed
Closed
@p31d4

Description

@p31d4

Hi,

I'm trying to send a can message in a virtualized Linux machine (VM on native Windows), and a keep receiving a timeout in tpsock/init.py line 108 (self._socket.send(data,flags)) when I run the following code:

with Client(conn,  request_timeout=2, config=config) as client:
    client.tester_present()

The bus is working properly (I've tested it with can-utils) and the problem is somehow related to the "select" API, on method "rxthread_task". I've also tried the branch "fix_socket_connection_that_blocks_on_open_close", but the problem was still there.

I fixed the problem locally re-writiing the method "rxthread_task" as:

while True:
    try:
        time.slee(0.2)
        data = self.tpsock.recv()
        if data is None:
            break
        else:
            self.rxqueue.put(data)
    except Exception:
        pass

Looks like the "select" API is blocking forever, but I'm not entirely sure.

Does someone already experienced this timeout issue and has any clue how to fix it without having to re-write the code?

Thanks and regards

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