Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NUTCH-3058 Fetcher: counter for hung threads #820

Conversation

sebastian-nagel
Copy link
Contributor

  • count the number of hung threads in a fetcher job
  • log and count the number of fetch items still queued when the "hard" timeout is reached

for (int i = 0; i < fetcherThreads.size(); i++) {
FetcherThread thread = fetcherThreads.get(i);
if (thread.isAlive()) {
LOG.warn("Thread #{} hung while processing {}", i,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could improve this logging by explicitly stating that DEBUG-level logging can be turned on for Stack-level granularity. Otherwise the Nutch admin would never know that.
wdyt @sebastian-nagel ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by explicitly stating that DEBUG-level logging can be turned on for Stack-level granularity.

You mean something like: LOG.warn("(Turn on DEBUG logging to log stack traces of hung threads.)"); ?

Not a bad idea. But maybe we could print the stack traces with level WARN? Hung threads are a severe event, if not an issue. It means that for minimum 5 minutes there was no page fetched (with the default value of mapreduce.task.timeout). So, it seems ok, to log the stacks of hung threads on level WARN. I'll update the PR...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think WARN logging here is called for. That sounds like a better solution. Thanks.

@lewismc
Copy link
Member

lewismc commented Sep 13, 2024

Once this has had more thorough peer review it would be great to add it to the Nutch Metrics documentation. I am +1 for the patch BTW.

- log stack traces of hung threads with level WARN (instead of DEBUG)
@sebastian-nagel sebastian-nagel merged commit 582cdd4 into apache:master Sep 16, 2024
4 checks passed
@sebastian-nagel sebastian-nagel deleted the NUTCH-3058-fetcher-counter-hung-threads branch September 16, 2024 17:47
@sebastian-nagel
Copy link
Contributor Author

Thanks for the discussion, @lewismc! The new counters were added to https://cwiki.apache.org/confluence/display/NUTCH/Metrics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants