ADB quota might not be decremented, part 2
The !6893 (merged) merge request, targeting the original issue #3598 (closed), has fixed some cases of ADB quota not being decremented back, but the affected customer continues experiencing the same issue.
I believe I have found another code path which can lead to the described behavior.
Normally, when a resquery_t object is created in fctx_query(), we call dns_adb_beginudpfetch() (which increases the ADB quota) only if it's a UDP query.
Then, in fctx_cancelquery(), we call dns_adb_endudpfetch() to decreases back the ADB quota, again only if it's a UDP query.
The problem, I think, is that a UDP query can become a TCP query, preventing the quota from adjusting back in fctx_cancelquery() later.
Edited by Arаm Sаrgsyаn