From 93ae5fb35b59a0e294baeef6e9902f56627c0de0 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 17 Nov 2026 23:33:05 +0000 Subject: [PATCH] fix(routing): remove unsynchronized write in GetFuncInfo (#40409) (#40421) Backport #40409 by @lazerg `GetFuncInfo` wrote the friendly name into `funcInfoNameMap` once without holding `funcInfoMapMu`, right before the same locked write. Concurrent requests hitting that branch could then crash the process with `fatal error: concurrent map writes`. This drops the unlocked write. Fixes: https://github.com/go-gitea/gitea/issues/40407 Assisted-by: Claude Code:claude-opus-5-5 Co-authored-by: Lazizbek Ergashev Co-authored-by: Lunny Xiao --- modules/web/routing/funcinfo.go | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/web/routing/funcinfo.go b/modules/web/routing/funcinfo.go index 7776c975b24..932c4a93429 100644 --- a/modules/web/routing/funcinfo.go +++ b/modules/web/routing/funcinfo.go @@ -62,7 +62,6 @@ func GetFuncInfo(fn any, friendlyName ...string) *FuncInfo { info = copyFuncInfo(info) info.shortName = name - funcInfoNameMap[name] = info funcInfoMapMu.Lock() funcInfoNameMap[name] = info funcInfoMapMu.Unlock()