Skip to content
Permalink
Browse files
webkitpy: Hang when workers write to the same stack trace file
https://bugs.webkit.org/show_bug.cgi?id=178402
<rdar://problem/35033432>

Reviewed by Aakash Jain.

Workers can hang if they all write to the same stack trace file when receiving
a SIGTERM. Attach the pid to the stack trace file name so that each worker
writes to a different file.

* Scripts/webkitpy/common/interupt_debugging.py:
(log_stack_trace_on_term.handler): Name stack trace file path/<pid>-filename.
(log_stack_trace_on_cntrl_c.handler): Ditto.


Canonical link: https://commits.webkit.org/194633@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
JonWBedard committed Oct 17, 2017
1 parent 73b8ca0 commit 1a20c1405c907129c9174d626527aaed363506af
Showing 2 changed files with 25 additions and 6 deletions.
@@ -1,3 +1,19 @@
2017-10-17 Jonathan Bedard <jbedard@apple.com>

webkitpy: Hang when workers write to the same stack trace file
https://bugs.webkit.org/show_bug.cgi?id=178402
<rdar://problem/35033432>

Reviewed by Aakash Jain.

Workers can hang if they all write to the same stack trace file when receiving
a SIGTERM. Attach the pid to the stack trace file name so that each worker
writes to a different file.

* Scripts/webkitpy/common/interupt_debugging.py:
(log_stack_trace_on_term.handler): Name stack trace file path/<pid>-filename.
(log_stack_trace_on_cntrl_c.handler): Ditto.

2017-10-17 John Wilander <wilander@apple.com>

Add and remove cookie partition accordingly in intermediary redirect requests
@@ -20,6 +20,7 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import os
import linecache
import logging
import signal
@@ -43,14 +44,15 @@ def func(frame):

def log_stack_trace_on_term(output_file=None):
def handler(signum, frame):
file = open(output_file, 'w') if output_file else sys.stderr
file_name = os.path.join(os.path.dirname(output_file), '{}-{}'.format(os.getpid(), os.path.basename(output_file))) if output_file else None
file = open(file_name, 'w') if file_name else sys.stderr
if not file:
raise RuntimeError('{} cannot be opened'.format(output_file))
raise RuntimeError('{} cannot be opened'.format(file_name))

if file is sys.stderr:
file.write('\n')
else:
_log.critical('Stack trace saved to {}'.format(output_file))
_log.critical('Stack trace saved to {}'.format(file_name))
file.write('SIGTERM signal received')
log_stack_trace(frame, file)
exit(-1)
@@ -60,14 +62,15 @@ def handler(signum, frame):

def log_stack_trace_on_cntrl_c(output_file=None):
def handler(signum, frame):
file = open(output_file, 'w') if output_file else sys.stderr
file_name = os.path.join(os.path.dirname(output_file), '{}-{}'.format(os.getpid(), os.path.basename(output_file))) if output_file else None
file = open(file_name, 'w') if file_name else sys.stderr
if not file:
raise RuntimeError('{} cannot be opened'.format(output_file))
raise RuntimeError('{} cannot be opened'.format(file_name))

if file is sys.stderr:
file.write('\n')
else:
_log.critical('Stack trace saved to {}'.format(output_file))
_log.critical('Stack trace saved to {}'.format(file_name))
file.write('cntrl C received\n')
log_stack_trace(frame, file)
raise KeyboardInterrupt

0 comments on commit 1a20c14

Please sign in to comment.