-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consensus simple merging #8953
Consensus simple merging #8953
Conversation
cvat-ui/src/components/consensus-management-page/consensus-management-page.tsx
Outdated
Show resolved
Hide resolved
cvat/apps/engine/utils.py
Outdated
@@ -148,13 +148,16 @@ def parse_exception_message(msg: str) -> str: | |||
pass | |||
return parsed_msg | |||
|
|||
def process_failed_job(rq_job: Job): | |||
def process_failed_job(rq_job: Job, *, logger: logging.Logger | None = None) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do this? I think we should just let each module log with its own logger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly to allow each module to use the corresponding logger. It was a fixed logger before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean... the module is also fixed. It's cvat.apps.engine.utils
. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is currently used from consensus and from engine. Consensus passes it's own logger. How would you like it to be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep the function the same as it was before. ('cvat.server.engine'
ought to be replaced by __name__
, but that's unrelated to this PR.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then consensus will print errors into the engine logger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the problem with that? All the logger does is identify the module that emitted the message. In this case, the module is cvat.apps.engine.utils
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that the produced log messages are both misleading (the module name) and uninformative (no full stacktrace to the message source):
[2025-02-21 14:53:11,412] ERROR cvat.server.engine: Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/rq/worker.py", line 1431, in perform_job
rv = job.perform()
File "/opt/venv/lib/python3.10/site-packages/rq/job.py", line 1280, in perform
self._result = self._execute()
File "/opt/venv/lib/python3.10/site-packages/rq/job.py", line 1317, in _execute
result = self.func(*self.args, **self.kwargs)
File "/home/django/cvat/apps/profiler.py", line 12, in wrapped
return f(*args, **kwargs)
File "/home/django/cvat/apps/consensus/merging_manager.py", line 249, in _merge
return _TaskMerger(task=job.get_task_id()).merge_single_consensus_job(target_id)
File "/usr/lib/python3.10/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/home/django/cvat/apps/consensus/merging_manager.py", line 157, in merge_single_consensus_job
self._merge_consensus_jobs(parent_job_id)
File "/home/django/cvat/apps/consensus/merging_manager.py", line 102, in _merge_consensus_jobs
raise Exception("test")
Exception: test
Another problem I see is that they also may expose sensitive information, as they are returned from the API for any exception type and show the full stacktrace.
I decided to revert the change, because improvements require a separate PR and fixing just the logger name doesn't change the situation significantly.
|
Motivation and context
Depends on #8939, #9026
A part of #8434
consensus
RQ queue and workerLimitations:
How has this been tested?
Checklist
develop
branch(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.