SAN FRANCISCO — Everyone knows that litigation often settles on the eve of trial. But sometimes it takes the reality of a retrial to bring the parties to the bargaining table.

That was the case for Silicon Valley rivals Brocade Communications Systems Inc. and A10 Networks Inc., which reached a settlement in their long-running intellectual property spat even as jury selection was underway for a new trial on damages.