Skip to content

service层获取requst上下文时,优先从restStrategyContext获取,在没使用异步情况下,会不会有内存泄漏问题 #200

Open
@testc1

Description

@testc1
每次getCurret时,都给当前线程绑定了一个初始的context,但是并没有看见调用clean方法

public ServletRequestAttributes getRestAttributes() {
// 异步场景下 会复制请求信息到RestStrategyContext
RequestAttributes requestAttributes = RestStrategyContext.getCurrentContext().getRequestAttributes();
if (requestAttributes == null) {
requestAttributes = RequestContextHolder.getRequestAttributes();
}
return (ServletRequestAttributes) requestAttributes;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions