Skip to content

Commit 15614e4

Browse files
committed
revert some handles of cancellederror
1 parent af52fa2 commit 15614e4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

ydb/_topic_writer/topic_writer_asyncio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ async def _send_loop(self, writer: "WriterAsyncIOStream"):
539539
writer.write([m])
540540
except asyncio.CancelledError:
541541
# the loop task cancelled be parent code, for example for reconnection
542-
pass
542+
# no need to stop all work.
543+
raise
543544
except BaseException as e:
544545
self._stop(e)
545546
raise

ydb/aio/credentials.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def consume(self, timeout=3):
1818
if self._value is None:
1919
try:
2020
await asyncio.wait_for(self._condition.wait(), timeout=timeout)
21-
except BaseException:
21+
except Exception:
2222
return self._value
2323
return self._value
2424

@@ -41,7 +41,7 @@ async def _wrapped_execution(self, callback):
4141
res = callback()
4242
if asyncio.iscoroutine(res):
4343
await res
44-
except BaseException:
44+
except Exception:
4545
pass
4646

4747
finally:
@@ -81,11 +81,15 @@ async def _refresh(self):
8181
except (KeyboardInterrupt, SystemExit):
8282
return
8383

84-
except BaseException as e:
84+
except Exception as e:
8585
self.last_error = str(e)
8686
await asyncio.sleep(1)
8787
self._tp.submit(self._refresh)
8888

89+
except BaseException as e:
90+
self.last_error = str(e)
91+
raise
92+
8993
async def token(self):
9094
current_time = time.time()
9195
if current_time > self._refresh_in:

ydb/aio/pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ async def run(self):
170170
while True:
171171
try:
172172
successful = await self.execute_discovery()
173-
except BaseException:
173+
except Exception:
174174
successful = False
175175
if successful:
176176
self._cache.complete_discovery(None)

0 commit comments

Comments
 (0)