Skip to content

Conversation

@christian-schilling
Copy link
Member

Previously it was simply assumed that HEAD always points to
refs/heads/master but as it turns out that is far from true.
Now HEAD is queried per repo from the upstream and forwarded.
Unfortunately it seems that it is not avoidable to to an extra
request to the upstream server for this. (calling ls-remote)

Previously it was simply assumed that HEAD always points to
refs/heads/master but as it turns out that is far from true.
Now HEAD is queried per repo from the upstream and forwarded.
Unfortunately it seems that it is not avoidable to to an extra
request to the upstream server for this. (calling ls-remote)
With the new git release sometimes the merge will be done by
"ort" instead of "recursive". We don't really care about that
as the results are the same.
type Polls =
Arc<std::sync::Mutex<std::collections::HashSet<(String, josh_proxy::auth::Handle, String)>>>;

type HeadsMap = Arc<std::sync::RwLock<std::collections::HashMap<String, String>>>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why a RwLock here, or more precisely why doesn't it also benefit the places where we use Mutex?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right that a Mutex would probably work just as well given how small the critical section actually is. It is a very read heavy thing though. In the end I don't think we will be able to tell the difference with regards to performance. If any of this shared structures will ever turn out be an actual bottleneck we will need something else anyway...

@christian-schilling christian-schilling merged commit 96fca6b into master Nov 26, 2021
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