Answer
Shear-out occurs when the edge margin $Y$ (distance from groove to shaft end) is insufficient to support the axial load. The stress is calculated as $\tau = P / (\pi D Y)$. To prevent this, the edge margin should be increased to at least $3$ times the groove depth $d$. If the shaft length is fixed, the material of the shaft must be upgraded to a higher shear strength alloy (e.g., from 1018 to 4140 steel), or the thrust load must be distributed over multiple rings. In aerospace, we often use a 'reinforced' end-cap to provide additional support to the shaft edge.