fix: bypass Sedna network timeouts during local offline benchmarking#552
fix: bypass Sedna network timeouts during local offline benchmarking#552karyxx wants to merge 2 commits into
Conversation
Signed-off-by: karyxx <pulkit.kr1924@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: karyxx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @karyxx! It looks like this is your first PR to kubeedge/ianvs 🎉 |
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to bypass local or invalid HTTP endpoints to speed up offline runs by patching Sedna's HTTP request client. However, this patching logic is duplicated across benchmarking.py and core/cmd/benchmarking.py. Feedback recommends extracting this logic into a shared helper function in core/common/utils.py to adhere to DRY principles. Additionally, the current implementation logs that the bypass is active even when it is disabled, and it incurs unnecessary performance overhead by querying the environment variable on every single HTTP request.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Signed-off-by: karyxx <pulkit.kr1924@gmail.com>
|
I have moved the logic inside |
What type of PR is this?
/kind bug
/kind feature
What this PR does / why we need it:
This PR introduces a global network bypass patch for the Sedna client inside
benchmarking.pyandcore/cmd/benchmarking.py.Why is it needed?
When running Ianvs benchmarks locally, there is no active KubeEdge Cloud controller or Knowledge Base server. Despite this, the Sedna backend client attempts REST calls to remote/null endpoints. Because it is decorated with
tenacityretry logic, it retries failed attempts up to 5 times with 3-second waits (15 seconds total per call).Across multiple incremental seen/unseen training and evaluation rounds, these network timeouts block execution, wasting up to 15–20 minutes of idle wait time per benchmarking job.
What does this patch do?
sedna.service.client.http_requestfunction at the Ianvs entry points.None/,127.0.0.1,localhost).ConnectionError("Connection refused.")to bypass the 15-second retry loops. This allows Sedna's internal try/except blocks to run and gracefully fall back to local offline mechanisms without any delay.BYPASS_TIMEOUTS(default:"1"/ enabled). If set to"0", the bypass is disabled.How to test it?
To run benchmarks normally with the bypass enabled:
To run benchmarks with the bypass disabled (original timeout behavior):
Fixes #494