aliyun / aliyun/aliyun-log-python-sdk

QueuedLogHandler worker 终止条件问题

Open
#152 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
176
Forks
119
Avg merge
3h 56m
Merged PRs (30d)
2

Description

现在的实现即使队列为空,也要等足 close_wait 这里的必要性是什么呢?

 def _post(self):
     while not self.stop_flag or (time() - self.stop_time) <= self.close_wait:
         items = self._get_batch_log_items(self.put_wait)
         if not items:
             continue

         # 发送逻辑

造成的问题是,在进程结束时,要无谓等待 5 秒钟。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at QueuedLogHandler._post and inspect how stop_flag, stop_time, close_wait, and _get_batch_log_items interact during shutdown. Reproduce termination with an empty queue and verify that the worker exits without an unnecessary five-second wait while still handling queued log items.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.