New issue
Advanced search Search tips

Issue 764385 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Print python stack trace on SIGUSR1

Project Member Reported by mar...@chromium.org, Sep 12 2017

Issue description

When the swarming bot python process receives a SIGUSR1, print a stack trace of all the threads. On SIGUSR2, start an interactive shell? This one is trickier as stderr is redirected by default.
 
Project Member

Comment 2 by bugdroid1@chromium.org, Sep 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-py.git/+/1829f7ad8d86624c44b01247699f8d79965f5b92

commit 1829f7ad8d86624c44b01247699f8d79965f5b92
Author: Marc-Antoine Ruel <maruel@chromium.org>
Date: Wed Sep 20 01:00:40 2017

swarming: improve the signal handling documentation

Otherwise it's not documented anywhere that it works, so nobody will ever use
it.

R=vadimsh@chromium.org
Bug:764385
Change-Id: I3e016950eb12b7e6c5d0faf01b187b523d2a2bf4
Reviewed-on: https://chromium-review.googlesource.com/673852
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>

[modify] https://crrev.com/1829f7ad8d86624c44b01247699f8d79965f5b92/appengine/swarming/doc/Bot.md

Comment 3 by mar...@chromium.org, Sep 20 2017

Status: Fixed (was: Started)
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-py.git/+/f008e7266e9da37909ce40eab2c53dcff040d424

commit f008e7266e9da37909ce40eab2c53dcff040d424
Author: Marc-Antoine Ruel <maruel@chromium.org>
Date: Mon Sep 25 16:41:18 2017

swarming_bot: use logging.error instead of stderr

When printing the stack trace, stderr isn't consistently redirected across OSes
and startup environments.

In bot_main, logging is always redirected to swarming_bot.log.
On systemd, bot_main stderr can be in seen via journalctl.
On gnome startup, I have no idea where stderr goes to.
On OSX via launchd, we generally redirect bot_main stderr to bot_stderr.log.

In task_runner, it'll be sent to task_runner.log.
run_isolated is even more problematic, as it can't afford to corrupt stderr.

R=vadimsh@chromium.org
Bug:  764385 
Change-Id: I47f96df02787a843894c0426424c4f701cb746de
Reviewed-on: https://chromium-review.googlesource.com/679174
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>

[modify] https://crrev.com/f008e7266e9da37909ce40eab2c53dcff040d424/appengine/swarming/swarming_bot/signal_trace.py
[modify] https://crrev.com/f008e7266e9da37909ce40eab2c53dcff040d424/appengine/swarming/swarming_bot/signal_trace_test.py

Sign in to add a comment