BladeTenantInterceptor 和 BladeRequestMappingHandlerMapping 之间处理时间过长

Blade 未结 1 1087
jues
jues 剑圣 2021-03-10 15:22

一、该问题的重现步骤是什么?

 

================  Request Start  ================

===> GET: /dept/list Parameters: {"bladeUser":{"clientId":"sword","userId":1123598821738675201,"account":"admin","userName":"admin","nickName":"管理员","tenantId":"000000","oauthId":"","deptId":"1123598813738675201","postId":"-1","roleId":"1123598816738675201,1336882477830041601","roleName":"administrator,homepage_labeler","detail":{}},"dept":{"current":"1","size":"10"}}

===Headers===  content-length: 0

===Headers===  X-Forwarded-Prefix: /blade-system

===Headers===  Accept: */*

===Headers===  User-Agent: PostmanRuntime/7.26.10

===Headers===  X-Forwarded-Proto: http

===Headers===  X-Forwarded-Host: 192.168.6.203:8088

===Headers===  Accept-Encoding: gzip, deflate, br

===Headers===  X-Forwarded-Port: 8088

===Headers===  Authorization: Basic c3dvcmQ6c3dvcmRfc2VjcmV0

===Headers===  Forwarded: proto=http;host="192.168.6.203:8088";for="192.168.13.89:49595"

===Headers===  host: 192.168.6.203:8106

===Headers===  X-Forwarded-For: 192.168.13.89

===Headers===  Postman-Token: b11f8eaf-230b-424b-badf-4918c60f95ad

===Headers===  Blade-Auth: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJ1c2VyX25hbWUiOiJhZG1pbiIsInJlYWxfbmFtZSI6IueuoeeQhuWRmDEiLCJhdmF0YXIiOiJodHRwczovL2d3LmFsaXBheW9iamVjdHMuY29tL3pvcy9ybXNwb3J0YWwvQmlhemZhbnhtYW1OUm94eFZ4a2EucG5nIiwiYXV0aG9yaXRpZXMiOlsiaG9tZXBhZ2VfbGFiZWxlciIsImFkbWluaXN0cmF0b3IiXSwiY2xpZW50X2lkIjoic3dvcmQiLCJyb2xlX25hbWUiOiJhZG1pbmlzdHJhdG9yLGhvbWVwYWdlX2xhYmVsZXIiLCJsaWNlbnNlIjoicG93ZXJlZCBieSBibGFkZXgiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjExMjM1OTg4MjE3Mzg2NzUyMDEiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMSwxMzM2ODgyNDc3ODMwMDQxNjAxIiwic2NvcGUiOlsiYWxsIl0sIm5pY2tfbmFtZSI6IueuoeeQhuWRmCIsIm9hdXRoX2lkIjoiIiwiZGV0YWlsIjpudWxsLCJleHAiOjE2MTU2NDQ0MzQsImRlcHRfaWQiOiIxMTIzNTk4ODEzNzM4Njc1MjAxIiwianRpIjoiNTE4OTAxYTctNjI1OS00ZTYwLWFkOTUtNmNiM2M0ZjgxMWEyIiwiYWNjb3VudCI6ImFkbWluIn0.IxvKlYe_Sdi4DstIs_shPfllJMCT1lSbUkvJbeQUmF0

================   Request End   ================


2021-03-10 15:14:24.609 DEBUG 2377 --- [ XNIO-1 task-13] o.s.core.tenant.BladeTenantInterceptor   : Original SQL: SELECT  id,tenant_id,parent_id,dept_name,full_name,ancestors,dept_category,sort,remark,is_deleted  FROM blade_dept 

 WHERE  is_deleted=0

2021-03-10 15:14:24.611 DEBUG 2377 --- [ XNIO-1 task-13] o.s.core.tenant.BladeTenantInterceptor   : parser sql: SELECT id, tenant_id, parent_id, dept_name, full_name, ancestors, dept_category, sort, remark, is_deleted FROM blade_dept WHERE is_deleted = 0

2021-03-10 15:14:38.656 DEBUG 2377 --- [ XNIO-1 task-14] .c.c.v.BladeRequestMappingHandlerMapping : Mapped to org.springblade.system.feign.DataScopeClient#getDataScopeByMapper(String, String)

2021-03-10 15:14:38.672 DEBUG 2377 --- [ XNIO-1 task-13] o.s.system.mapper.DeptMapper.selectList  : ==>  Preparing: SELECT id, tenant_id, parent_id, dept_name, full_name, ancestors, dept_category, sort, remark, is_deleted FROM blade_dept WHERE is_deleted = 0

2021-03-10 15:14:38.676 DEBUG 2377 --- [ XNIO-1 task-13] o.s.system.mapper.DeptMapper.selectList  : ==> Parameters: 

2021-03-10 15:14:38.679 DEBUG 2377 --- [ XNIO-1 task-13] o.s.system.mapper.DeptMapper.selectList  : <==      Total: 11


==============  Sql Start  ==============

Execute ID  :org.springblade.system.mapper.DeptMapper.selectList

Execute SQL :SELECT id, tenant_id, parent_id, dept_name, full_name, ancestors, dept_category, sort, remark, is_deleted FROM blade_dept WHERE is_deleted = 0

Execute Time:4 ms

==============  Sql  End   ==============

2. 

3.


二、你期待的结果是什么?实际看到的又是什么?


o.s.core.tenant.BladeTenantInterceptor 和 .c.c.v.BladeRequestMappingHandlerMapping 之间为什么会跑了14秒?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?


BladeX 2.7.0 Centos7


四、请提供详细的错误堆栈信息,这很重要。


五、若有更多详细信息,请在下面提供。

1条回答
  • 2021-03-11 16:48

    虽然日志打印这俩是连在一起的,但这其实也不一定就是 BladeTenantInterceptor 的问题,list接口是秒响应的。具体情况还需要一步一步调试。

    比如从BladeTenantInterceptor打断点,再到controller内打断点,查看日志的差距等等。

    如果你找到了可以大概率重现这问题的步骤,麻烦再完善一下帖子,我们会进行跟踪排查

    0 讨论(0)
提交回复