membphis commented on code in PR #12686:
URL: https://github.com/apache/apisix/pull/12686#discussion_r2476153552
##########
apisix/ssl/router/radixtree_sni.lua:
##########
@@ -149,11 +150,15 @@ function _M.match_and_set(api_ctx, match_only, alt_sni)
local err
if not radixtree_router or
radixtree_router_ver ~= ssl_certificates.conf_version then
+ local span = tracer.new_span("create_router", tracer.kind.internal)
radixtree_router, err = create_router(ssl_certificates.values)
if not radixtree_router then
+ span:set_status(tracer.status.ERROR, "failed create router")
+ tracer.finish_current_span()
return false, "failed to create radixtree router: " .. err
end
radixtree_router_ver = ssl_certificates.conf_version
+ tracer.finish_current_span()
Review Comment:
I have the same issue when I review this code first time
APISIX will encounter an error if there are concurrent requests.
<img width="613" height="297" alt="Image"
src="https://github.com/user-attachments/assets/e1ef5df2-f7ad-46c3-8673-751aa877d674"
/>
New way(should same as @bzp2010)
<img width="794" height="301" alt="Image"
src="https://github.com/user-attachments/assets/8a75f5fe-e0a4-4375-8e97-84c80445be5a"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]