Skip to content

chore: Follow up to #731 #743

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

Merged
merged 5 commits into from
May 18, 2022
Merged

chore: Follow up to #731 #743

merged 5 commits into from
May 18, 2022

Conversation

efritz
Copy link
Contributor

@efritz efritz commented May 13, 2022

Following up from additional comments in #731 (some were hidden by the long timeline in the github view pre merge, and @DaedalusG and I forgot to address these in our 1-1).

Test plan

N/A.

@efritz efritz requested review from LawnGnome and DaedalusG May 13, 2022 19:15
@efritz efritz self-assigned this May 13, 2022
@efritz efritz mentioned this pull request May 13, 2022
@@ -114,7 +113,7 @@ func archiveCompose(ctx context.Context, zw *zip.Writer, verbose, noConfigs bool
// setup channel for slice of archive function outputs
ch := make(chan *archiveFile)
g, ctx := errgroup.WithContext(ctx)
semaphore := semaphore.NewWeighted(8)
semaphore := semaphore.NewWeighted(int64(runtime.GOMAXPROCS(0)))
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is interesting, I'm not familiar with runtime.GOMAXPROCS(0), will definitely do some research here 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It gives you the recommended number of processes/goroutines that can run in parallel (not just concurrently). It's relational to your cpu die count.

Copy link
Contributor

@DaedalusG DaedalusG May 18, 2022

Choose a reason for hiding this comment

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

Hmm, will this potentially reintroduce issues with open file limits? Or reduce the effectiveness of the semaphore in throttling remotely executed requests? In my understanding, this will scale the semaphore's limit to the host machine running src's resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Number of cpu cores is way under the Linux file handle limit by many orders of magnitude

Copy link
Contributor

@DaedalusG DaedalusG left a comment

Choose a reason for hiding this comment

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

This looks good and mostly seems like clarification of naming conventions. Except semaphore := semaphore.NewWeighted(int64(runtime.GOMAXPROCS(0))) which I'll need to learn more about.

Has the command been tested with these changes? If not I'm happy to test these out before merge.

Approving anyway

@efritz efritz merged commit 29df2bd into main May 18, 2022
@efritz efritz deleted the ef/wip branch May 18, 2022 16:11
scjohns pushed a commit that referenced this pull request Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants