Another possible strategy would be to wrap those low-level DBI calls in logic that specifically catches error #2000, and responds by sleeping for a short-but-random period of time and trying the request again a certain number of times before giving up. This becomes a targeted response to a specific error condition, applied only when DBI informs you that the error in question just did occur.
sub doit {
my $dbh = shift;
# IF ASYNC ERROR OCCURS, RETRY THIS MANY TIMES
for my $retry (1..10) {
$dbh->execute();
# LEAVE NOW IF THE ERROR (IF ANY) IS OTHER THAN "ASYNC"
return $dbh->err unless $dbh->err == 2000;
# ASYNC ERROR ... TAKE A RANDOM SHORT NAP
sleep(100*rand());
}
# OH DEAR ...
die "asynchronous I/O error";
}
Something like that ...