Skip to content

[#13041] fix(server): Add @ResponseMetered to JobOperations#cancelJob - #13046

Merged
jerryshao merged 1 commit into
apache:mainfrom
AzazelSensei:fix-13041-cancel-job-response-metered
Sep 10, 2026
Merged

jerryshao merged 1 commit into
apache:mainfrom
AzazelSensei:fix-13041-cancel-job-response-metered

Conversation

@AzazelSensei

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

I added @ResponseMetered(name = "cancel-job", absolute = true) on JobOperations#cancelJob, next to the existing @Timed, same as the other eight endpoints in that class.

Why are the changes needed?

cancelJob only had @Timed. Without @ResponseMetered, the Jersey listener never registers gravitino-server.cancel-job.2xx-responses (or 4xx/5xx), so /metrics shows cancel latency but not outcome.

Fix: #13041

Does this PR introduce any user-facing change?

No API or property changes. Cancel responses start showing up on /metrics like the sibling endpoints.

How was this patch tested?

./gradlew :server:test --tests org.apache.gravitino.server.web.rest.TestJobOperations.testCancelJobIsResponseMetered -PskipITs

…celJob

cancelJob was the only JobOperations endpoint without @ResponseMetered,
so /metrics never recorded 2xx/4xx/5xx for cancel.
@jerryshao
jerryshao merged commit 2fc0693 into apache:main Sep 10, 2026
41 of 42 checks passed
@github-actions

Copy link
Copy Markdown

Code Coverage Report

Overall Project 69.69% +0.58% 🟢
Files changed 77.71% 🟢

Module Coverage
aliyun 19.74% 🔴
api 51.61% 🟢
authorization-common 85.96% 🟢
authorization-ranger 4.38% 🔴
aws 53.54% 🟢
azure 32.1% 🔴
catalog-common 27.9% 🔴
catalog-fileset 82.17% -1.05% 🟢
catalog-glue 70.84% +2.38% 🟢
catalog-hive 82.96% -2.87% 🟢
catalog-jdbc-common 45.09% +0.7% 🟢
catalog-jdbc-doris 82.69% +2.28% 🟢
catalog-jdbc-mysql 79.33% +13.02% 🟢
catalog-jdbc-postgresql 83.83% +16.94% 🟢
catalog-jdbc-starrocks 79.16% 🟢
catalog-kafka 76.99% +18.92% 🟢
catalog-lakehouse-generic 60.88% -29.12% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.9% 🟢
catalog-lakehouse-paimon 84.29% -2.98% 🟢
catalog-model 77.99% +44.06% 🟢
cli 44.51% 🟢
client-java 77.5% 🟢
common 57.86% -0.04% 🟢
core 84.36% -0.01% 🟢
filesystem-hadoop3 76.48% 🟢
flink 0.0% 🔴
flink-common 53.22% +3.19% 🟢
flink-runtime 0.0% 🔴
gcp 32.2% 🔴
hadoop-auth 68.0% 🟢
hadoop-common 17.84% -0.34% 🔴
hive-metastore-common 53.52% +4.58% 🟢
iceberg-aliyun-bundle 0.0% 🔴
iceberg-common 66.21% -0.73% 🟢
iceberg-rest-server 76.8% +2.06% 🟢
idp-basic 86.75% 🟢
integration-test-common 0.0% 🔴
jobs 62.92% 🟢
lance-common 34.02% 🔴
lance-rest-server 68.12% -10.7% 🟢
lineage 59.39% 🟢
optimizer 83.17% 🟢
optimizer-api 21.95% 🔴
server 89.87% -0.77% 🟢
server-common 81.35% 🟢
spark 56.27% 🟢
tencent 81.78% 🟢
trino-connector 58.36% -0.03% 🟢
Files
Module File Coverage
catalog-fileset FilesetCatalogOperations.java 82.0% 🟢
catalog-glue GlueExceptionConverter.java 100.0% 🟢
GlueTableOperations.java 90.52% 🟢
catalog-hive TrinoNativeViewCodec.java 92.96% 🟢
HiveCatalogOperations.java 81.64% 🟢
HiveViewCatalogOperations.java 78.9% 🟢
HiveTableOperations.java 77.33% 🟢
catalog-jdbc-common JdbcTable.java 70.37% 🟢
catalog-jdbc-doris DorisTableOperations.java 84.91% 🟢
catalog-jdbc-mysql MysqlTableOperations.java 85.68% 🟢
catalog-jdbc-postgresql PostgreSqlTypeConverter.java 98.84% 🟢
PostgreSqlTableOperations.java 86.99% 🟢
catalog-kafka KafkaCatalogOperations.java 81.03% 🟢
catalog-lakehouse-generic LanceTableOperations.java 62.92% 🟢
GenericCatalogOperations.java 28.69% 🔴
catalog-lakehouse-paimon CatalogUtils.java 43.24% 🔴
catalog-model ModelCatalogOperations.java 85.9% 🟢
common ErrorResponse.java 54.32% 🔴
core GroupRoleRelPostgreSQLProvider.java 100.0% 🟢
PrincipalUtils.java 65.0% 🟢
flink-common TypeUtils.java 95.08% 🟢
hadoop-common FileSystemUtils.java 33.33% 🔴
HDFSFileSystemProxy.java 0.0% 🔴
hive-metastore-common HiveClientFactory.java 85.22% 🟢
ProxyHiveClientImpl.java 80.95% 🟢
HiveExceptionConverter.java 80.72% 🟢
HmsKerberosClient.java 80.7% 🟢
Util.java 71.79% 🟢
HiveClientImpl.java 0.0% 🔴
iceberg-common IcebergCatalogUtil.java 61.25% 🟢
iceberg-rest-server IcebergExceptionMapper.java 98.15% 🟢
FederatedCatalogWrapper.java 90.28% 🟢
IcebergRESTUtils.java 88.73% 🟢
IcebergTableOperations.java 81.28% 🟢
lance-rest-server LanceExceptionMapper.java 76.74% 🟢
LanceRESTService.java 7.69% 🔴
server JobOperations.java 93.86% 🟢
GravitinoServer.java 65.77% 🟢
spark-common SparkJdbcTypeConverter.java 83.33% 🟢
trino-connector MySQLExternalDataType.java 93.1% 🟢
PostgreSQLDataTypeTransformer.java 30.95% 🔴

jerryshao added a commit that referenced this pull request Sep 10, 2026
…d to JobOperations#cancelJob (#13046) (#13070)

**Cherry-pick Information:**
- Original commit: 2fc0693
- Target branch: `branch-1.3`
- Status: ✅ **Conflicts resolved**

Conflicts in `TestJobOperations.java` were resolved by keeping only
`testCancelJobIsResponseMetered` from the original commit. The other
tests in the conflict block depend on features that are not in
`branch-1.3`.

---------

Co-authored-by: Abdullah <[email protected]>
Co-authored-by: Jerry Shao <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch-1.3 Automatically cherry-pick commit to branch-1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement] JobOperations#cancelJob is missing @ResponseMetered so its responses are absent from /metrics

2 participants