Skip to content
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

chore: skip orchestrator info requests if service uri not set by orchestrator #3149

Merged

Conversation

ad-astra-video
Copy link
Collaborator

@ad-astra-video ad-astra-video commented Aug 21, 2024

What does this pull request do? Explain your changes. (required)
Update db_discovery.go to skip starting orchestrator http client if the service uri is not set by the orchestrator. At time of this commit, 71 orchestrators have not registered for the AI subnet so this skips a lot of failed http connections.

Docker build is at docker pull adastravideo/go-livepeer:ai-video-test

Specific updates (required)

  • add a check to confirm a Host exists in the parsed service uri.

How did you test each of these updates (required)
Built docker file and started up gateway
startup.log

Checklist:

@github-actions github-actions bot added the AI Issues and PR related to the AI-video branch. label Aug 21, 2024
@leszko leszko deleted the branch livepeer:master November 7, 2024 08:26
@leszko leszko closed this Nov 7, 2024
@rickstaa rickstaa reopened this Nov 13, 2024
@rickstaa rickstaa changed the base branch from ai-video to master November 13, 2024 21:49
@rickstaa
Copy link
Member

@ad-astra-video Do we still need this now that we've merged into the master branch? Are there any orchestrators that still have their service URI set to an empty string ("") by mistake? I noticed this issue once before, but I'm not sure if any orchestrators are still affected.

@ad-astra-video
Copy link
Collaborator Author

The AI service registry is still not fully used by Orchestrators. This is just a thing to ease development starting gateways faster. For production gateways it is not likely noticed much.

I have not issue closing this but it also doesn't make sense to try to connect to a URL that is blank.

@ad-astra-video
Copy link
Collaborator Author

Counted the empty entries on last test gateway startup. There are still 59 empty urls in the AIServiceRegistry.

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.

Project coverage is 33.71534%. Comparing base (8d48192) to head (9c08eeb).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
discovery/db_discovery.go 42.85714% 3 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3149         +/-   ##
===================================================
- Coverage   33.72602%   33.71534%   -0.01068%     
===================================================
  Files            141         141                 
  Lines          37434       37434                 
===================================================
- Hits           12625       12621          -4     
- Misses         24088       24091          +3     
- Partials         721         722          +1     
Files with missing lines Coverage Δ
discovery/db_discovery.go 69.23077% <42.85714%> (-1.02945%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53734a4...9c08eeb. Read the comment docs.

Files with missing lines Coverage Δ
discovery/db_discovery.go 69.23077% <42.85714%> (-1.02945%) ⬇️

ad-astra-video and others added 2 commits January 20, 2025 21:20
This commit makes minor updates to comments for better clarity and consistency. No
functional code changes are included.
@rickstaa rickstaa force-pushed the ai-video-skip-no-service-uri-orchs branch from ff9da55 to d4691bc Compare January 20, 2025 20:27
This commit refactors the orchestration skip logic by replacing the use of a new
data channel with a direct error throw.
Copy link
Member

@rickstaa rickstaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ad-astra-video I’ve simplified the logic in this commit. If you’re aligned with this change, we can proceed with the merge.

@rickstaa rickstaa requested a review from victorges January 21, 2025 09:53
@@ -278,7 +278,7 @@ func (dbo *DBOrchestratorPoolCache) cacheDBOrchs() error {
}
// Do not connect if URI host is not set
if uri.Host == "" {
skipped <- 1
errc <- fmt.Errorf("skipping orch=%v, URI not set", dbOrch.EthereumAddr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victorges Should we throw this error, or would it be cleaner to simply display the fetched orchestrators? See @ad-astra-video's first solution (i.e. 6667483).

@rickstaa rickstaa requested a review from leszko February 10, 2025 11:15
@leszko leszko merged commit b675d4a into livepeer:master Feb 10, 2025
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Issues and PR related to the AI-video branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants