You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "MartijnVisser (via GitHub)" <gi...@apache.org> on 2026/07/13 20:41:30 UTC
[PR] [FLINK-31931] Return 404 for a gone TaskManager and stop the Web UI from re-polling it [flink]
MartijnVisser opened a new pull request, #28735:
URL: https://github.com/apache/flink/pull/28735
## What is the purpose of the change
Requesting `/taskmanagers/:taskmanagerid` for a TaskManager that is no longer registered (for example after a TaskManager is lost while the Web UI's TaskManager page keeps polling it, or when following a link from a job's exception history) returned HTTP 500 with an `Unhandled exception` ERROR log on the JobManager, and the Web UI kept re-requesting it indefinitely.
This returns a proper 404 for a gone TaskManager and stops the futile polling, showing a clear "TaskManager not available" notice instead of an endless skeleton.
This supersedes #22542 (thanks @JunRuiLee for the original investigation). That PR addressed FLINK-31931 by preventing the exception-history page from linking to a gone TaskManager. Handling the not-found at the destination instead is more robust: it also covers deep-links and a TaskManager dying while its page is open, it is not racy (a TaskManager can disappear right after the link is rendered), and it keeps the link informative for the common case where the exception's TaskManager is already gone by the time the history is viewed.
## Brief change log
- **[runtime/rest]** `TaskManagerDetailsHandler` strips the failure with `stripCompletionException` (not `stripExecutionException`), so the `UnknownTaskExecutorException` to `NOT_FOUND` mapping actually fires; this matches the sibling TaskManager handlers. Previously a gone TaskManager produced a 500 plus a repeated `Unhandled exception` ERROR log.
- **[runtime-web]** `loadManager` no longer swallows errors; a shared poll helper stops polling once the backend reports the TaskManager is gone (404), while transient errors keep retrying. The TaskManager status view shows a "TaskManager not available" notice and the metric cards are hidden instead of rendering blank tables.
## Verifying this change
- New unit test `TaskManagerDetailsHandlerTest#testUnknownTaskExecutorLeadsToNotFound` asserts a 404 for an unknown TaskManager id.
- New Vitest specs cover the poll helper (stops on 404, keeps retrying on transient errors) and the status/metrics components (notice shown / cards hidden on 404).
- Manually verified on a standalone cluster: killing a TaskManager now yields a single 404 that stops repeating, a "TaskManager not available" notice, and no `Unhandled exception` ERROR log on the JobManager, versus the previous endless 500s.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
## AI Usage Disclosure
- [x] Claude Code
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-31931] Return 404 for a gone TaskManager and stop the Web UI from re-polling it [flink]
Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on PR #28735:
URL: https://github.com/apache/flink/pull/28735#issuecomment-4983838796
> Is "410 Gone" a better response code here if we knew the TaskManager was there but is gone and this is permanent?
Good question. I'd keep 404 here. The status comes from mapping `UnknownTaskExecutorException`, which fires whenever the id isn't in the currently-registered set: we can't actually distinguish "was here, now gone" from "never existed" (a stale/deep-link with a bogus id hits the same path). It also keeps this handler consistent with the sibling TaskManager handlers (log list, profiling list, file handlers), which all map `UnknownTaskExecutorException` to `NOT_FOUND`; that consistency is exactly what this PR is fixing.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-31931] Return 404 for a gone TaskManager and stop the Web UI from re-polling it [flink]
Posted by "JunRuiLee (via GitHub)" <gi...@apache.org>.
JunRuiLee merged PR #28735:
URL: https://github.com/apache/flink/pull/28735
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-31931] Return 404 for a gone TaskManager and stop the Web UI from re-polling it [flink]
Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on PR #28735:
URL: https://github.com/apache/flink/pull/28735#issuecomment-5589064660
> @MartijnVisser Can you add before and after images to the PR.
Before:
<img width="1552" height="784" alt="before-01-tm-running" src="https://github.com/user-attachments/assets/71e17e5e-026f-4c26-9e4a-83ddf27d01d8" />
<img width="1552" height="784" alt="before-02-tm-gone-page-open" src="https://github.com/user-attachments/assets/654437b6-ecbc-44c7-b3d4-c94a9c24b67f" />
<img width="1552" height="784" alt="before-03-tm-gone-deeplink" src="https://github.com/user-attachments/assets/e83c616e-ef75-4798-b7cf-c3d2e3ba60ca" />
After:
<img width="1552" height="784" alt="after-01-tm-running" src="https://github.com/user-attachments/assets/4575c5c2-02c1-4549-b211-820d25a89e5a" />
<img width="1552" height="784" alt="after-02-tm-gone-page-open" src="https://github.com/user-attachments/assets/e7f396aa-ec7f-4d68-89c6-388eab5aa48d" />
<img width="1552" height="784" alt="after-03-tm-gone-deeplink" src="https://github.com/user-attachments/assets/517081c8-b45e-468b-8fd3-475488034eb9" />
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-31931] Return 404 for a gone TaskManager and stop the Web UI from re-polling it [flink]
Posted by "doguscan-namal (via GitHub)" <gi...@apache.org>.
doguscan-namal commented on PR #28735:
URL: https://github.com/apache/flink/pull/28735#issuecomment-4966893108
Is "410 Gone" a better response code here if we knew the TaskManager was there but is gone and this is permanent? https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/410
Otherwise, 404 default should be fine.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-31931] Return 404 for a gone TaskManager and stop the Web UI from re-polling it [flink]
Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on PR #28735:
URL: https://github.com/apache/flink/pull/28735#issuecomment-5589058961
Added a before/after section to the description; screenshots follow. Also rebased and fixed one thing the screenshots showed: the expected 404 was popping up as a "Server Response Message" with the server stack trace, so the request is now marked as expecting a 404 and the interceptor skips the notification for it.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-31931] Return 404 for a gone TaskManager and stop the Web UI from re-polling it [flink]
Posted by "spuru9 (via GitHub)" <gi...@apache.org>.
spuru9 commented on PR #28735:
URL: https://github.com/apache/flink/pull/28735#issuecomment-4962533035
@MartijnVisser Can you add before and after images to the PR.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-31931] Return 404 for a gone TaskManager and stop the Web UI from re-polling it [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #28735:
URL: https://github.com/apache/flink/pull/28735#issuecomment-4962520655
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fde2d9e389a8823bffd229383e7dd452b57059fb",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "fde2d9e389a8823bffd229383e7dd452b57059fb",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fde2d9e389a8823bffd229383e7dd452b57059fb UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org