Landed from contributor PR #39197 by @scoootscooob. Co-authored-by: scoootscooob <zhentongfan@gmail.com>