Splitting WELD-1791 into two issues. Let's apply it to 3.x initially and once it proves stable backport it to 2.x