Add warnings when overriding RequestContext
authorMirek Klimos <miro@fb.com>
Fri, 11 Nov 2016 19:15:55 +0000 (11:15 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Fri, 11 Nov 2016 19:23:43 +0000 (11:23 -0800)
commit1d2d4f326acc0825690c151c38ac92d146b78146
treedf5fae3907e35caae6589dd7baf3180fab7f815a
parentd07b730bfe2fa85c84db257108ee293ef1a38ae0
Add warnings when overriding RequestContext

Summary: We currently store the previous value on creation of RequestContextScopeGuard and reset it to the previous one when it goes out of scope - this means that if it's not unset properly somewhere, we'll prolong its life by saving it and restoring later. We need to do this because of some edge cases but a RequestContext should generally never be overridden by a different RequestContext - let's add a warning if this happens

Reviewed By: djwatson, palmtenor

Differential Revision: D3971904

fbshipit-source-id: e72b5f01102d18977d8aa5f8dca5a7802545098a
folly/io/async/Request.h