You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org> on 2019/03/26 15:19:06 UTC

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Zoltan Borok-Nagy has uploaded this change for review. ( http://gerrit.cloudera.org:8080/12858


Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................

IMPALA-8359: Fix coverage data generation for impalads

impala::InitCommonRuntime() sets a signal handler for SIGTERM.
Sometimes we already have a signal handler that we want to use.
E.g. when building with code coverage, the gcov runtime also
registers a signal handler that writes the coverage data.

I added a global 'old_sigaction' variable that stores the old
signal handler and invoke it in HandleSigTerm().

I tested manually.

Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
---
M be/src/common/init.cc
1 file changed, 19 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/58/12858/1
-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 5: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 5
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 09:12:07 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 1:

Build Failed 

https://jenkins.impala.io/job/gerrit-code-review-checks/2540/ : Initial code review checks failed. See linked job for details on the failure.


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Comment-Date: Tue, 26 Mar 2019 15:45:57 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 4: Code-Review+2

Thanks for fixing this!


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 4
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 03:37:06 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/12858/2/be/src/common/init.cc
File be/src/common/init.cc:

http://gerrit.cloudera.org:8080/#/c/12858/2/be/src/common/init.cc@199
PS2, Line 199:   // We measure code coverage that needs cleanup of resources to flush coverage data.
             :   // In this case we risk calling exit() that does the cleanup unlike _exit().
             :   exit(0);
It's good to track this down. I'm glad we know this is due to the change to an _exit(0) call.

There is a function called __gcov_flush() that dumps the coverage data. You can declare it and use it if you link with "-lgcov". I think a common pattern is to call it before _exit(0). I did a quick check, and it seems to work. 

Kudu also has some code to flush coverage data (see TryFlushCoverage() in be/src/kudu/util/debug-util.cc in our repo). If we link with -lgcov and call kudu::TryFlushCoverage() before _exit(0), then that would work. Kudu uses clang for coverage rather than gcc, but the same code should work.

I would prefer one of these two solutions rather than an exit() call, but as a workaround, I would approve this.



-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Wed, 27 Mar 2019 17:34:04 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Zoltan Borok-Nagy has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 6:

Thanks for the review and tips!


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 6
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 14:03:09 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................

IMPALA-8359: Fix coverage data generation for impalads

impala::InitCommonRuntime() sets a signal handler for SIGTERM.
It calls _exit(0) which causes normal program termination without
cleaning up, i.e. no destructors are called etc.

Gcov writes the coverage data in this cleanup phase, so calling
_exit() prevents flushing coverage data.

Now the '-codecoverage' flag also defines a macro named
CODE_COVERAGE_ENABLED. If this macro is defined we explicitly
call __gcov_flush() before calling _exit().

I tested manually.

Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Reviewed-on: http://gerrit.cloudera.org:8080/12858
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M be/CMakeLists.txt
M be/src/common/init.cc
2 files changed, 17 insertions(+), 1 deletion(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 6
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 3:

Build Failed 

https://jenkins.impala.io/job/gerrit-code-review-checks/2620/ : Initial code review checks failed. See linked job for details on the failure.


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 3
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Wed, 03 Apr 2019 15:27:11 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Hello Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/12858

to look at the new patch set (#2).

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................

IMPALA-8359: Fix coverage data generation for impalads

impala::InitCommonRuntime() sets a signal handler for SIGTERM.
It calls _exit(0) which causes normal program termination without
cleaning up, i.e. no destructors are called etc.

Gcov writes the coverage data in this cleanup phase, so calling
_exit() prevents flushing coverage data.

Now the '-codecoverage' flag also defines a macro named
CODE_COVERAGE_ENABLED. If this macro is defined we call exit()
instead of _exit(), because exit() cleans up the process properly.

I tested manually.

Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
---
M be/CMakeLists.txt
M be/src/common/init.cc
2 files changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/58/12858/2
-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Hello Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/12858

to look at the new patch set (#3).

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................

IMPALA-8359: Fix coverage data generation for impalads

impala::InitCommonRuntime() sets a signal handler for SIGTERM.
It calls _exit(0) which causes normal program termination without
cleaning up, i.e. no destructors are called etc.

Gcov writes the coverage data in this cleanup phase, so calling
_exit() prevents flushing coverage data.

Now the '-codecoverage' flag also defines a macro named
CODE_COVERAGE_ENABLED. If this macro is defined we explicitly
call __gcov_flush() before calling _exit().

I tested manually.

Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
---
M be/CMakeLists.txt
M be/src/common/init.cc
2 files changed, 19 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/58/12858/3
-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 3
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 2:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/2542/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Tue, 26 Mar 2019 18:02:34 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Zoltan Borok-Nagy has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 3:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/12858/2/be/src/common/init.cc
File be/src/common/init.cc:

http://gerrit.cloudera.org:8080/#/c/12858/2/be/src/common/init.cc@199
PS2, Line 199:   sys_write(STDOUT_FILENO, msg, strlen(msg));
             : #if CODE_COVERAGE_ENABLED
             :   // On so
> Yeah, I knew about __gcov_flush() and tried it out already, but it only gen
In an offline discussion we agreed that calling __gcov_flush() is the proper way.
Unfortunately __gcov_flush() only flushes a small fraction of the coverage data on some systems, so I added a comment about the workaround for users who run into this issue.



-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 3
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Wed, 03 Apr 2019 14:46:16 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 5:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/3981/ DRY_RUN=false


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 5
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 09:12:09 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 5: Verified+1


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 5
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 13:55:55 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 4:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/2621/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 4
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Wed, 03 Apr 2019 16:35:23 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Hello Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/12858

to look at the new patch set (#4).

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................

IMPALA-8359: Fix coverage data generation for impalads

impala::InitCommonRuntime() sets a signal handler for SIGTERM.
It calls _exit(0) which causes normal program termination without
cleaning up, i.e. no destructors are called etc.

Gcov writes the coverage data in this cleanup phase, so calling
_exit() prevents flushing coverage data.

Now the '-codecoverage' flag also defines a macro named
CODE_COVERAGE_ENABLED. If this macro is defined we explicitly
call __gcov_flush() before calling _exit().

I tested manually.

Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
---
M be/CMakeLists.txt
M be/src/common/init.cc
2 files changed, 17 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/58/12858/4
-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 4
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Zoltan Borok-Nagy has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 1: Code-Review-1

Turned out the problem is not with the new signal handler, but with the call to _exit().


-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Tue, 26 Mar 2019 17:05:46 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8359: Fix coverage data generation for impalads

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Zoltan Borok-Nagy has posted comments on this change. ( http://gerrit.cloudera.org:8080/12858 )

Change subject: IMPALA-8359: Fix coverage data generation for impalads
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/12858/2/be/src/common/init.cc
File be/src/common/init.cc:

http://gerrit.cloudera.org:8080/#/c/12858/2/be/src/common/init.cc@199
PS2, Line 199:   // We measure code coverage that needs cleanup of resources to flush coverage data.
             :   // In this case we risk calling exit() that does the cleanup unlike _exit().
             :   exit(0);
> It's good to track this down. I'm glad we know this is due to the change to
Yeah, I knew about __gcov_flush() and tried it out already, but it only generated the coverage data for the Common lib.

I didn't know about kudu::TryFlushCoverage(), but it didn't flush the coverage data at all for me. Not even when I added -lgcov explicitly.



-- 
To view, visit http://gerrit.cloudera.org:8080/12858
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be1e1e73b6cfc3557077f763aee4dbfcc7a2d27
Gerrit-Change-Number: 12858
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Fri, 29 Mar 2019 17:32:03 +0000
Gerrit-HasComments: Yes