You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Lars Volker (Code Review)" <ge...@cloudera.org> on 2018/04/23 18:27:44 UTC

[Impala-ASF-CR] IMPALA-6889: Fix race around terminating processes

Lars Volker has uploaded this change for review. ( http://gerrit.cloudera.org:8080/10156


Change subject: IMPALA-6889: Fix race around terminating processes
......................................................................

IMPALA-6889: Fix race around terminating processes

A process with empty cmdline can trip up the Process class in our test
code. When a process dies it becomes a zombie until it gets reaped by
its parent.

From 'man proc':

/proc/[pid]/cmdline
  This read-only file holds the complete command line for the
  process, unless the process is a zombie.  In the latter case,
  there is nothing in this file: that is, a read on this file
  will return 0 characters.  The command-line arguments appear
  in this file as a set of strings separated by null bytes
  ('\0'), with a further null byte after the last string.

To fix this, we take a copy of the cmdline before passing it to the
Process ctor to prevent it from changing.

I couldn't come up with a test for this.

Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
---
M tests/common/impala_cluster.py
1 file changed, 11 insertions(+), 6 deletions(-)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
Gerrit-Change-Number: 10156
Gerrit-PatchSet: 1
Gerrit-Owner: Lars Volker <lv...@cloudera.com>

[Impala-ASF-CR] IMPALA-6889: Fix race around terminating processes

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/10156 )

Change subject: IMPALA-6889: Fix race around terminating processes
......................................................................

IMPALA-6889: Fix race around terminating processes

A process with empty cmdline can trip up the Process class in our test
code. When a process dies it becomes a zombie until it gets reaped by
its parent.

From 'man proc':

/proc/[pid]/cmdline
  This read-only file holds the complete command line for the
  process, unless the process is a zombie.  In the latter case,
  there is nothing in this file: that is, a read on this file
  will return 0 characters.  The command-line arguments appear
  in this file as a set of strings separated by null bytes
  ('\0'), with a further null byte after the last string.

To fix this, we take a copy of the cmdline before passing it to the
Process ctor to prevent it from changing.

I couldn't come up with a test for this.

Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
Reviewed-on: http://gerrit.cloudera.org:8080/10156
Reviewed-by: Michael Brown <mi...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M tests/common/impala_cluster.py
1 file changed, 13 insertions(+), 6 deletions(-)

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

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
Gerrit-Change-Number: 10156
Gerrit-PatchSet: 3
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>

[Impala-ASF-CR] IMPALA-6889: Fix race around terminating processes

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

Change subject: IMPALA-6889: Fix race around terminating processes
......................................................................


Patch Set 2: Verified+1


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
Gerrit-Change-Number: 10156
Gerrit-PatchSet: 2
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Comment-Date: Wed, 25 Apr 2018 21:19:21 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-6889: Fix race around terminating processes

Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Hello Michael Brown, 

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

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

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

Change subject: IMPALA-6889: Fix race around terminating processes
......................................................................

IMPALA-6889: Fix race around terminating processes

A process with empty cmdline can trip up the Process class in our test
code. When a process dies it becomes a zombie until it gets reaped by
its parent.

From 'man proc':

/proc/[pid]/cmdline
  This read-only file holds the complete command line for the
  process, unless the process is a zombie.  In the latter case,
  there is nothing in this file: that is, a read on this file
  will return 0 characters.  The command-line arguments appear
  in this file as a set of strings separated by null bytes
  ('\0'), with a further null byte after the last string.

To fix this, we take a copy of the cmdline before passing it to the
Process ctor to prevent it from changing.

I couldn't come up with a test for this.

Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
---
M tests/common/impala_cluster.py
1 file changed, 13 insertions(+), 6 deletions(-)


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
Gerrit-Change-Number: 10156
Gerrit-PatchSet: 2
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>

[Impala-ASF-CR] IMPALA-6889: Fix race around terminating processes

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

Change subject: IMPALA-6889: Fix race around terminating processes
......................................................................


Patch Set 2: Code-Review+2

Thanks again for investigating this.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
Gerrit-Change-Number: 10156
Gerrit-PatchSet: 2
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Comment-Date: Tue, 24 Apr 2018 19:44:41 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-6889: Fix race around terminating processes

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

Change subject: IMPALA-6889: Fix race around terminating processes
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/10156/1/tests/common/impala_cluster.py
File tests/common/impala_cluster.py:

http://gerrit.cloudera.org:8080/#/c/10156/1/tests/common/impala_cluster.py@116
PS1, Line 116:         cmdline = process.cmdline
> Will this actually fix the race, or narrow the race? It seems like the race
I don't know if we'll be able to get rid of the race between L104 and L116 completely, but I think this change mitigates it. Even if we call (access the property) process.cmdline immediately after L104 we might receive an empty cmdline from it. Creating the *Process() objects below only copies the cmdline, and they do liveliness checks themselves in Process.get_pid().

I cleaned up the checks a bit in PS2.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
Gerrit-Change-Number: 10156
Gerrit-PatchSet: 1
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Comment-Date: Tue, 24 Apr 2018 03:29:35 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-6889: Fix race around terminating processes

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

Change subject: IMPALA-6889: Fix race around terminating processes
......................................................................


Patch Set 2:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/2360/


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
Gerrit-Change-Number: 10156
Gerrit-PatchSet: 2
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Comment-Date: Wed, 25 Apr 2018 17:24:35 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-6889: Fix race around terminating processes

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

Change subject: IMPALA-6889: Fix race around terminating processes
......................................................................


Patch Set 1:

(1 comment)

Thanks again for looking!

http://gerrit.cloudera.org:8080/#/c/10156/1/tests/common/impala_cluster.py
File tests/common/impala_cluster.py:

http://gerrit.cloudera.org:8080/#/c/10156/1/tests/common/impala_cluster.py@116
PS1, Line 116:         cmdline = process.cmdline
Will this actually fix the race, or narrow the race? It seems like the race between L104 and L116 still exists. I agree that from L116 onward is an improvement, so I don't want to block this, just asking the question at this time.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iecf630e0b71d91469650636e81f940a7bec07113
Gerrit-Change-Number: 10156
Gerrit-PatchSet: 1
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 23 Apr 2018 19:02:43 +0000
Gerrit-HasComments: Yes