mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Remove no quota leased warning from quota handler inactive callback
When EPP SSL handshake is unsuccessful, #channelInactive is called but there are no quotas to return, because quotas are only leased upon the first #channelRead. There is no need to log a warning and throw an exception in this case because the handshake exception would have been thrown already. Throwing a second exception just crowds the log. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=197016756
This commit is contained in:
parent
44890c2964
commit
0fb845e81a
1 changed files with 6 additions and 3 deletions
|
@ -150,15 +150,18 @@ public abstract class QuotaHandler extends ChannelInboundHandlerAdapter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the leased token back to the token store upon connection termination.
|
||||
* Returns the leased token (if available) back to the token store upon connection termination.
|
||||
*
|
||||
* <p>A connection with concurrent quota needs to do this in order to maintain its quota number
|
||||
* invariance.
|
||||
*/
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) {
|
||||
checkNotNull(quotaResponse, "No quota was leased, return not possible.");
|
||||
// If no reads occurred before the connection is inactive (for example when the handshake
|
||||
// is not successful), no quota is leased and therefore no return is needed.
|
||||
if (quotaResponse != null) {
|
||||
Future<?> unusedFuture = quotaManager.releaseQuota(QuotaRebate.create(quotaResponse));
|
||||
}
|
||||
ctx.fireChannelInactive();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue