Backport: Issue 2187 maintenance 3.x