Skip to content

Commit 60e936a

Browse files
committed
HubSpot Backport HBASE-26727 Fix CallDroppedException reporting
1 parent 66b2e38 commit 60e936a

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/ExceptionTrackingSource.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public interface ExceptionTrackingSource extends BaseSource {
4444
String EXCEPTIONS_QUOTA_EXCEEDED = "exceptions.quotaExceeded";
4545
String EXCEPTIONS_RPC_THROTTLING = "exceptions.rpcThrottling";
4646
String EXCEPTIONS_CALL_DROPPED = "exceptions.callDropped";
47+
String EXCEPTIONS_CALL_TIMED_OUT = "exceptions.callTimedOut";
4748

4849
void exception();
4950

@@ -62,4 +63,5 @@ public interface ExceptionTrackingSource extends BaseSource {
6263
void quotaExceededException();
6364
void rpcThrottlingException();
6465
void callDroppedException();
66+
void callTimedOut();
6567
}

hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/ExceptionTrackingSourceImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public class ExceptionTrackingSourceImpl extends BaseSourceImpl
4141
protected MutableFastCounter exceptionsQuotaExceeded;
4242
protected MutableFastCounter exceptionsRpcThrottling;
4343
protected MutableFastCounter exceptionsCallDropped;
44+
protected MutableFastCounter exceptionsCallTimedOut;
4445

4546
public ExceptionTrackingSourceImpl(String metricsName, String metricsDescription,
4647
String metricsContext, String metricsJmxContext) {
@@ -75,6 +76,8 @@ public void init() {
7576
.newCounter(EXCEPTIONS_RPC_THROTTLING, EXCEPTIONS_TYPE_DESC, 0L);
7677
this.exceptionsCallDropped = this.getMetricsRegistry()
7778
.newCounter(EXCEPTIONS_CALL_DROPPED, EXCEPTIONS_TYPE_DESC, 0L);
79+
this.exceptionsCallTimedOut = this.getMetricsRegistry()
80+
.newCounter(EXCEPTIONS_CALL_TIMED_OUT, EXCEPTIONS_TYPE_DESC, 0L);
7881
}
7982

8083
@Override
@@ -141,4 +144,9 @@ public void rpcThrottlingException() {
141144
public void callDroppedException() {
142145
exceptionsCallDropped.incr();
143146
}
147+
148+
@Override
149+
public void callTimedOut() {
150+
exceptionsCallTimedOut.incr();
151+
}
144152
}

hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public void run() {
104104
call.setStartTime(System.currentTimeMillis());
105105
if (call.getStartTime() > call.getDeadline()) {
106106
RpcServer.LOG.warn("Dropping timed out call: " + call);
107+
this.rpcServer.getMetrics().callTimedOut();
107108
return;
108109
}
109110
this.status.setStatus("Setting up call");

hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ public void exception(Throwable throwable) {
135135
}
136136
}
137137

138+
void callTimedOut() {
139+
source.callTimedOut();
140+
}
141+
138142
public MetricsHBaseServerSource getMetricsSource() {
139143
return source;
140144
}

0 commit comments

Comments
 (0)