1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-09 14:56:07 +02:00
git/trace2
Josh Steadmon 538ac74604 trace2: disable tr2_dst before warning on write errors
If writing a trace2 message fails, we optionally warn the user of this
fact. However, in 0ee10fd (usage: add trace2 entry upon warning(),
2020-11-23), we added a trace entry to the warning() function. This
means that we can enter an infinite loop of failing trace2 writes and
warnings. Fix this by disabling the failing trace2 destination before
issuing the warning.

Additionally, trace2 sets a default SIGPIPE handler
(tr2main_signal_handler) when it is initialized. This handler generates
its own trace2 messages when a signal is received. If a trace2 write
fails due to a broken pipe, this handler will run and then cause another
failed write. Fix this by temporarily ignoring SIGPIPE while writing
trace2 messages. This is safe because the write will still fail, and we
will disable the failing destination.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-18 22:38:15 -08:00
..
tr2_cfg.c trace2: teach Git to log environment variables 2020-03-23 13:14:53 -07:00
tr2_cfg.h trace2: teach Git to log environment variables 2020-03-23 13:14:53 -07:00
tr2_cmd_name.c trace2: rename environment variables to GIT_TRACE2* 2019-05-28 10:20:34 -07:00
tr2_cmd_name.h
tr2_dst.c trace2: disable tr2_dst before warning on write errors 2021-11-18 22:38:15 -08:00
tr2_dst.h trace2: write discard message to sentinel files 2019-10-05 17:53:51 +09:00
tr2_sid.c Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00
tr2_sid.h
tr2_sysenv.c trace2: teach Git to log environment variables 2020-03-23 13:14:53 -07:00
tr2_sysenv.h trace2: teach Git to log environment variables 2020-03-23 13:14:53 -07:00
tr2_tbuf.c trace2: make SIDs more unique 2019-04-16 13:37:07 +09:00
tr2_tbuf.h trace2: make SIDs more unique 2019-04-16 13:37:07 +09:00
tr2_tgt.h trace2: add absolute elapsed time to start event 2019-04-16 13:37:06 +09:00
tr2_tgt_event.c trace2: write discard message to sentinel files 2019-10-05 17:53:51 +09:00
tr2_tgt_normal.c trace2: write discard message to sentinel files 2019-10-05 17:53:51 +09:00
tr2_tgt_perf.c trace2: add dots directly to strbuf in perf_fmt_prepare() 2019-11-06 11:45:18 +09:00
tr2_tls.c Merge branch 'jh/trace2' 2019-05-30 10:50:45 -07:00
tr2_tls.h trace2: refactor setting process starting time 2019-04-16 13:37:06 +09:00