yuqi1129 commented on PR #12994:
URL: https://github.com/apache/gravitino/pull/12994#issuecomment-5598060245
> One more nit, on a line that falls outside this PR's diff so it can't be
anchored inline — `JobManager.java:343-347`, in `alterJobTemplate`:
>
> ```java
> } catch (NoSuchEntityException e) {
> throw new NoSuchJobTemplateException(
> "Job template with name %s under metalake %s does not exist, this
could be due to"
> + " the job template not existing or updated concurrently. For
the latter case"
> + " please retry the operation.",
> jobTemplateName, metalake);
> }
> ```
>
> That message predates OCC. Now that `updateJobTemplate` routes a losing
CAS through `OccWriteSupport.updateWithVersion` -> `writeFailure`, the "updated
concurrently" case raises `OptimisticLockException` (409) and no longer reaches
this catch — arriving here now genuinely means the template does not exist. The
"or updated concurrently ... please retry" half is stale and will send users
chasing the wrong cause.
>
> For contrast, `cancelJob`'s equivalent message at `:547` ("not existing or
being deleted concurrently") is still accurate, since a concurrent _delete_
does still surface as `NoSuchEntityException`. So only the `alterJobTemplate`
one needs trimming.
Changed as suggested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]