nacos-group / nacos-group/nacos-sdk-python
使用ctrl+c强制退出时,_process_polling_result无法处理异常
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 471
- Forks
- 155
- PR merge metrics
- No merged PRs in 30d
Description
`Traceback (most recent call last):
File "d:\project\tailin\dev\crawler.conda\Lib\multiprocessing\connection.py", line 328, in _recv_bytes
nread, err = ov.GetOverlappedResult(True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [WinError 109] 管道已结束。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\project\tailin\dev\crawler.conda\Lib\site-packages\nacos\client.py", line 818, in _process_polling_result
cache_key, content, md5 = self.notify_queue.get()
^^^^^^^^^^^^^^^^^^^^^^^
File "d:\project\tailin\dev\crawler.conda\Lib\multiprocessing\queues.py", line 103, in get
res = self._recv_bytes()
^^^^^^^^^^^^^^^^^^
File "d:\project\tailin\dev\crawler.conda\Lib\multiprocessing\connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\project\tailin\dev\crawler.conda\Lib\multiprocessing\connection.py", line 337, in _recv_bytes
raise EOFError
EOFError`
主动关闭主进程后, self.notify_queue,无法与主进程通信抛出异常。但是未做处理
怎么自己的代码中在生成对象后,遇到ctrl+c时处理这个错误呢
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with nacos/client.py at _process_polling_result and reproduce the Ctrl+C shutdown described in the traceback on Windows. Trace how notify_queue is closed when the main process exits, then determine the expected behavior for the resulting EOFError; done means the shutdown path no longer produces an unhandled exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100