[backfire] backport upstream commit f2df1ae3fe8d44d51bd7218a9da9134b83c7531e