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

[Enhancement] log stack trace in FE thrift service (backport #47491) #47502

Closed
wants to merge 1 commit into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jun 26, 2024

Why I'm doing:

https://logging.staged.apache.org/log4j/2.x/manual/pattern-layout.html

    @Override
    public TReportFragmentFinishResponse reportFragmentFinish(TReportFragmentFinishParams params) {
        final TReportFragmentFinishResponse result = new TReportFragmentFinishResponse();
        final QueryInfo info = coordinatorMap.get(params.query_id);
        final TUniqueId fragment_instance_id = params.fragment_instance_id;
        try {
            info.getCoord().scheduleNextTurn(fragment_instance_id);
        } catch (Exception e) {
            // TODO cancel by error
            LOG.error("schedule error", e);
        }
        result.setStatus(new TStatus(TStatusCode.OK));
        return result;
    }

prev:

java.lang.NullPointerException: null
2024-06-25 16:57:46.313+08:00 WARN (thrift-server-pool-789|1206) [QeProcessorImpl.reportFragmentFinish():301] schedule error
java.lang.NullPointerException: null
2024-06-25 16:58:23.110+08:00 WARN (thrift-server-pool-1223|1748) [QeProcessorImpl.reportFragmentFinish():301] schedule error
java.lang.NullPointerException: nul

now

2024-06-25 19:28:02.640+08:00 ERROR (thrift-server-pool-3|172) [QeProcessorImpl.reportFragmentFinish():308] schedule error
 java.lang.NullPointerException
        at com.starrocks.qe.QeProcessorImpl.reportFragmentFinish(QeProcessorImpl.java:305)
        at com.starrocks.service.FrontendServiceImpl.reportFragmentFinish(FrontendServiceImpl.java:2930)
        at com.starrocks.thrift.FrontendService$Processor$reportFragmentFinish.getResult(FrontendService.java:5957)
        at com.starrocks.thrift.FrontendService$Processor$reportFragmentFinish.getResult(FrontendService.java:5934)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:40)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:40)
        at com.starrocks.common.SRTThreadPoolServer$WorkerProcess.run(SRTThreadPoolServer.java:311)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

This is an automatic backport of pull request #47491 done by [Mergify](https://mergify.com). ## Why I'm doing: https://logging.staged.apache.org/log4j/2.x/manual/pattern-layout.html
    @Override
    public TReportFragmentFinishResponse reportFragmentFinish(TReportFragmentFinishParams params) {
        final TReportFragmentFinishResponse result = new TReportFragmentFinishResponse();
        final QueryInfo info = coordinatorMap.get(params.query_id);
        final TUniqueId fragment_instance_id = params.fragment_instance_id;
        try {
            info.getCoord().scheduleNextTurn(fragment_instance_id);
        } catch (Exception e) {
            // TODO cancel by error
            LOG.error("schedule error", e);
        }
        result.setStatus(new TStatus(TStatusCode.OK));
        return result;
    }

prev:

java.lang.NullPointerException: null
2024-06-25 16:57:46.313+08:00 WARN (thrift-server-pool-789|1206) [QeProcessorImpl.reportFragmentFinish():301] schedule error
java.lang.NullPointerException: null
2024-06-25 16:58:23.110+08:00 WARN (thrift-server-pool-1223|1748) [QeProcessorImpl.reportFragmentFinish():301] schedule error
java.lang.NullPointerException: nul

now

2024-06-25 19:28:02.640+08:00 ERROR (thrift-server-pool-3|172) [QeProcessorImpl.reportFragmentFinish():308] schedule error
 java.lang.NullPointerException
        at com.starrocks.qe.QeProcessorImpl.reportFragmentFinish(QeProcessorImpl.java:305)
        at com.starrocks.service.FrontendServiceImpl.reportFragmentFinish(FrontendServiceImpl.java:2930)
        at com.starrocks.thrift.FrontendService$Processor$reportFragmentFinish.getResult(FrontendService.java:5957)
        at com.starrocks.thrift.FrontendService$Processor$reportFragmentFinish.getResult(FrontendService.java:5934)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:40)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:40)
        at com.starrocks.common.SRTThreadPoolServer$WorkerProcess.run(SRTThreadPoolServer.java:311)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Signed-off-by: stdpain <[email protected]>
(cherry picked from commit 553e115)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/common/Log4jConfig.java
@mergify mergify bot added the conflicts label Jun 26, 2024
Copy link
Contributor Author

mergify bot commented Jun 26, 2024

Cherry-pick of 553e115 has failed:

On branch mergify/bp/branch-2.5/pr-47491
Your branch is up to date with 'origin/branch-2.5'.

You are currently cherry-picking commit 553e115f5b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-core/src/main/java/com/starrocks/common/Log4jConfig.java

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Copy link
Contributor Author

mergify bot commented Jun 26, 2024

@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr

@wanpengfei-git wanpengfei-git enabled auto-merge (squash) June 26, 2024 02:17
@mergify mergify bot closed this Jun 26, 2024
auto-merge was automatically disabled June 26, 2024 02:17

Pull request was closed

@mergify mergify bot deleted the mergify/bp/branch-2.5/pr-47491 branch June 26, 2024 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant