Re: [PATCH 2/5] refs: make get_files_ref_lock_timeout_ms() repostory aware
- From
Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>
- Date
- Mar 28, 2026, 12:51 UTC
- Message-ID
- <CAPYXD67BV5-FjvGVv1gcV2Fp8H3d815EZO0PVDWPfq=hJYP=Mg@mail.gmail.com>
- In-Reply-To
- <DHDGF1CL2QHP.101BB8D2101N8@gmail.com>
On Fri, Mar 27, 2026 at 2:54 PM Burak Kaan Karaçay <bkkaracay@gmail.com> wrote:
Show 22 quoted lines
>
> On Wed Mar 25, 2026 at 7:44 PM +03, Shreyansh Paliwal wrote:
> > -long get_files_ref_lock_timeout_ms(void)
> > +long get_files_ref_lock_timeout_ms(struct repository *repo)
> > {
> > static int configured = 0;
> >
> > @@ -998,7 +998,7 @@ long get_files_ref_lock_timeout_ms(void)
> > static int timeout_ms = 100;
> >
> > if (!configured) {
> > - repo_config_get_int(the_repository, "core.filesreflocktimeout", &timeout_ms);
> > + repo_config_get_int(repo, "core.filesreflocktimeout", &timeout_ms);
> > configured = 1;
> > }
> >
>
> Looks like the existing code uses static local variables for
> performance. They can behave unexpectedly in multi-repo cases.
>
> I think moving the config into 'repo-settings' should be considered. The
> config is already lazy-parsed, migrating it shouldn't be a problem.Yup, I agree that would be a logical change. We can take that up in a follow-up patch to this. Thanks.