You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[native] Fix incorrect initialization of 'folly::Promise' object
Fixesprestodb#26094
For a `folly::Promise` object that is expected to be overwritten, we
should use `folly::makeEmpty()` to initialize it (it is 'invalid')
instead of the default constructor (it will be 'valid' but
'not fulfilled', assigning to it will cause an exception). Creating an
exception triggers a stack unwind, which can saturate the CPU in
high-concurrency scenarios, causing significant performance issues.
We don't need to create a new Promise and destruct the previous one
in the `ResponseHandler::initialize()` function because
`ResponseHandler` isn't supposed to be reused. Therefore, we can
simplify the `ResponseHandler::initialize` method.
0 commit comments