Commit 65d64c0d authored by Nathan Bronson's avatar Nathan Bronson Committed by Facebook Github Bot

fix FutureTest/RequestContext

Summary: Fix use-after-destroy of NewThreadExecutor.  Detected by opt-ubsan tests.

Reviewed By: yfeldblum

Differential Revision: D4291900

fbshipit-source-id: 206f1d7b80fa04e1570e4b7a20e50b9a8ceb7bcb
parent a4e480b2
...@@ -822,8 +822,8 @@ TEST(Future, RequestContext) { ...@@ -822,8 +822,8 @@ TEST(Future, RequestContext) {
}; };
Promise<int> p1, p2; Promise<int> p1, p2;
NewThreadExecutor e;
{ {
NewThreadExecutor e;
folly::RequestContextScopeGuard rctx; folly::RequestContextScopeGuard rctx;
RequestContext::get()->setContextData( RequestContext::get()->setContextData(
"key", folly::make_unique<MyRequestData>(true)); "key", folly::make_unique<MyRequestData>(true));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment