]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_dahdi: Don't retry opening nonexistent channels on restart.
authorNaveen Albert <asterisk@phreaknet.org>
Tue, 26 Mar 2024 11:43:32 +0000 (07:43 -0400)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 9 May 2024 13:48:09 +0000 (13:48 +0000)
commitf1223a041bf2487cd604aed1cbef6570b3fa1868
treec4abce1100c7a54f3f7ebcacf020e7c4d53640fd
parentfb084a53c4529f4decb03b7f1051e75e5f6df08a
chan_dahdi: Don't retry opening nonexistent channels on restart.

Commit 729cb1d390b136ccc696430aa5c68d60ea4028be added logic to retry
opening DAHDI channels on "dahdi restart" if they failed initially,
up to 1,000 times in a loop, to address cases where the channel was
still in use. However, this retry loop does not use the actual error,
which means chan_dahdi will also retry opening nonexistent channels
1,000 times per channel, causing a flood of unnecessary warning logs
for an operation that will never succeed, with tens or hundreds of
thousands of open attempts being made.

The original patch would have been more targeted if it only retried
on the specific relevant error (likely EBUSY, although it's hard to
say since the original issue is no longer available).

To avoid the problem above while avoiding the possibility of breakage,
this skips the retry logic if the error is ENXIO (No such device or
address), since this will never succeed.

Resolves: #669
(cherry picked from commit 63aa08fa0b3e30e8d2f1406936c740bf5a5bf539)
channels/chan_dahdi.c