Improve error logs for task manager poller#197635
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
Co-authored-by: Patrick Mueller <patrick.mueller@elastic.co>
pmuellr
left a comment
There was a problem hiding this comment.
LGTM
Happened to think, once the new Error(\${err}`)` gets thrown, the stack trace will lead back to this function, rather than whoever sent the error (which the other case will do). But, we'd never be able to get THAT stack trace anyway, since apparently it's not an Error. Hoping 🤞🏻 that the "new" message in there will help us pinpoint where it's coming from though. Think it's be best we can do for now ...
@pmuellr yeah hopefully it can help a bit knowing the stack trace and where it was dropped so we can improve on that 🤞 |
💚 Build Succeeded
Metrics [docs]
History
cc @mikecote |
|
Starting backport for target branches: 8.16, 8.x |
I noticed some scenarios we see error logs from the task poller like `Failed to poll for work: undefined` making me think `err.message` is empty in some situations. I'm modifying the code to handle string situations if ever they occur by performing `err.message || err` and to also include a stack trace when strings are passed-in. --------- Co-authored-by: Patrick Mueller <patrick.mueller@elastic.co> (cherry picked from commit 81b63c6)
I noticed some scenarios we see error logs from the task poller like `Failed to poll for work: undefined` making me think `err.message` is empty in some situations. I'm modifying the code to handle string situations if ever they occur by performing `err.message || err` and to also include a stack trace when strings are passed-in. --------- Co-authored-by: Patrick Mueller <patrick.mueller@elastic.co> (cherry picked from commit 81b63c6)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [Improve error logs for task manager poller (#197635)](#197635) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Mike Côté","email":"mikecote@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-25T11:12:44Z","message":"Improve error logs for task manager poller (#197635)\n\nI noticed some scenarios we see error logs from the task poller like\r\n`Failed to poll for work: undefined` making me think `err.message` is\r\nempty in some situations. I'm modifying the code to handle string\r\nsituations if ever they occur by performing `err.message || err` and to\r\nalso include a stack trace when strings are passed-in.\r\n\r\n---------\r\n\r\nCo-authored-by: Patrick Mueller <patrick.mueller@elastic.co>","sha":"81b63c60eb6d1fe623f2e177cd55d2f285f79590","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Task Manager","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.16.0","v8.17.0"],"title":"Improve error logs for task manager poller","number":197635,"url":"https://github.com/elastic/kibana/pull/197635","mergeCommit":{"message":"Improve error logs for task manager poller (#197635)\n\nI noticed some scenarios we see error logs from the task poller like\r\n`Failed to poll for work: undefined` making me think `err.message` is\r\nempty in some situations. I'm modifying the code to handle string\r\nsituations if ever they occur by performing `err.message || err` and to\r\nalso include a stack trace when strings are passed-in.\r\n\r\n---------\r\n\r\nCo-authored-by: Patrick Mueller <patrick.mueller@elastic.co>","sha":"81b63c60eb6d1fe623f2e177cd55d2f285f79590"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197635","number":197635,"mergeCommit":{"message":"Improve error logs for task manager poller (#197635)\n\nI noticed some scenarios we see error logs from the task poller like\r\n`Failed to poll for work: undefined` making me think `err.message` is\r\nempty in some situations. I'm modifying the code to handle string\r\nsituations if ever they occur by performing `err.message || err` and to\r\nalso include a stack trace when strings are passed-in.\r\n\r\n---------\r\n\r\nCo-authored-by: Patrick Mueller <patrick.mueller@elastic.co>","sha":"81b63c60eb6d1fe623f2e177cd55d2f285f79590"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
# Backport This will backport the following commits from `main` to `8.16`: - [Improve error logs for task manager poller (#197635)](#197635) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Mike Côté","email":"mikecote@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-25T11:12:44Z","message":"Improve error logs for task manager poller (#197635)\n\nI noticed some scenarios we see error logs from the task poller like\r\n`Failed to poll for work: undefined` making me think `err.message` is\r\nempty in some situations. I'm modifying the code to handle string\r\nsituations if ever they occur by performing `err.message || err` and to\r\nalso include a stack trace when strings are passed-in.\r\n\r\n---------\r\n\r\nCo-authored-by: Patrick Mueller <patrick.mueller@elastic.co>","sha":"81b63c60eb6d1fe623f2e177cd55d2f285f79590","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Task Manager","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.16.0","v8.17.0"],"title":"Improve error logs for task manager poller","number":197635,"url":"https://github.com/elastic/kibana/pull/197635","mergeCommit":{"message":"Improve error logs for task manager poller (#197635)\n\nI noticed some scenarios we see error logs from the task poller like\r\n`Failed to poll for work: undefined` making me think `err.message` is\r\nempty in some situations. I'm modifying the code to handle string\r\nsituations if ever they occur by performing `err.message || err` and to\r\nalso include a stack trace when strings are passed-in.\r\n\r\n---------\r\n\r\nCo-authored-by: Patrick Mueller <patrick.mueller@elastic.co>","sha":"81b63c60eb6d1fe623f2e177cd55d2f285f79590"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197635","number":197635,"mergeCommit":{"message":"Improve error logs for task manager poller (#197635)\n\nI noticed some scenarios we see error logs from the task poller like\r\n`Failed to poll for work: undefined` making me think `err.message` is\r\nempty in some situations. I'm modifying the code to handle string\r\nsituations if ever they occur by performing `err.message || err` and to\r\nalso include a stack trace when strings are passed-in.\r\n\r\n---------\r\n\r\nCo-authored-by: Patrick Mueller <patrick.mueller@elastic.co>","sha":"81b63c60eb6d1fe623f2e177cd55d2f285f79590"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
I noticed some scenarios we see error logs from the task poller like
Failed to poll for work: undefinedmaking me thinkerr.messageis empty in some situations. I'm modifying the code to handle string situations if ever they occur by performingerr.message || errand to also include a stack trace when strings are passed-in.