DevAnswersQuestionsTagsUsersCompaniesJobsUnansweredLog inSign up

Widget.fetch() hangs forever after a reconnect — how do I make it time out?

Asked by halvard_n · viewed 4,412 times

After my device drops off USB and comes back, the next call to fetch() never returns. I read the library docs and the changelog, tried the reconnect example and searched the issue tracker without luck. Any ideas?

Tags: pythonasyncioserialacme-widgetstimeout

ShareEditFollowFlag

32 comments

ines_r · 2 hours ago

It is a race in the reconnect path, there is an open issue about it.

reply share flag

tobiasw · 3 hours ago

This looks like the buffer size default changed between releases.

reply share flag

k_mbeki · 4 hours ago

Does it still happen with the async API?

reply share flag

rsaxena · 5 hours ago

Can you post the full traceback? The second frame matters.

reply share flag

olga.v · 6 hours ago

Have you checked whether the serial port is opened twice?

reply share flag

dmitri_p · 7 hours ago

Setting the timeout explicitly made the error go away on my board.

reply share flag

sunita88 · 8 hours ago

Same here. The workaround below works but it is ugly.

reply share flag

fjord_dev · 9 hours ago

I hit the same thing on 3.12; pinning the driver fixed it for me.

reply share flag

a_nakashima · 10 hours ago

It is a race in the reconnect path, there is an open issue about it.

reply share flag

petra_l · 11 hours ago

This looks like the buffer size default changed between releases.

reply share flag

cwen · 12 hours ago

Setting the timeout explicitly made the error go away on my board.

reply share flag

b_oduya · 13 hours ago

Have you checked whether the serial port is opened twice?

reply share flag

lucca_m · 14 hours ago

I hit the same thing on 3.12; pinning the driver fixed it for me.

reply share flag

haru_t · 15 hours ago

Same here. The workaround below works but it is ugly.

reply share flag

zofia_k · 16 hours ago

This looks like the buffer size default changed between releases.

reply share flag

emeka_o · 17 hours ago

It is a race in the reconnect path, there is an open issue about it.

reply share flag

yusuf.a · 18 hours ago

Can you post the full traceback? The second frame matters.

reply share flag

marek_n · 19 hours ago

Does it still happen with the async API?

reply share flag

marlow_k · 20 hours ago

Setting the timeout explicitly made the error go away on my board.

reply share flag

priya_s · 21 hours ago

Have you checked whether the serial port is opened twice?

reply share flag

jonas_h · 22 hours ago

It is a race in the reconnect path, there is an open issue about it.

reply share flag

aline_c · 23 hours ago

This looks like the buffer size default changed between releases.

reply share flag

wen_li · 24 hours ago

Does it still happen with the async API?

reply share flag

tomas_r · 25 hours ago

Can you post the full traceback? The second frame matters.

reply share flag

greta_v · 26 hours ago

Have you checked whether the serial port is opened twice?

reply share flag

kofi_a · 27 hours ago

Setting the timeout explicitly made the error go away on my board.

reply share flag

mira_d · 28 hours ago

Same here. The workaround below works but it is ugly.

reply share flag

sven_b · 29 hours ago

I hit the same thing on 3.12; pinning the driver fixed it for me.

reply share flag

lea_m · 30 hours ago

It is a race in the reconnect path, there is an open issue about it.

reply share flag

raj_p · 31 hours ago

This looks like the buffer size default changed between releases.

reply share flag

nadia_f · 32 hours ago

Can you post the full traceback? The second frame matters.

reply share flag

oscar_t · 33 hours ago

Does it still happen with the async API?

reply share flag

More comments