mirror of
https://github.com/facebook/sapling.git
synced 2025-01-08 14:46:47 +03:00
sampling: run @atexitr handlers in a try/catch, log if failure
Summary: sunshowers hit an exception (either an upgrade race or a module deinitialization) and while it was spurious, it can't hurt to run this logic in a try/catch anyway. Reviewed By: ikostia Differential Revision: D8360101 fbshipit-source-id: e581bdeb69e22571f547633b7219d6886cab1aa7
This commit is contained in:
parent
2b01a523e3
commit
dedad2a212
@ -143,25 +143,25 @@ def gettopdir(repo):
|
||||
def reposetup(ui, repo):
|
||||
@repo.ui.atexit
|
||||
def telemetry():
|
||||
if util.safehasattr(repo, "requirements"):
|
||||
ui.log(
|
||||
"requirements",
|
||||
generaldelta=str("generaldelta" in repo.requirements).lower(),
|
||||
)
|
||||
ui.log(
|
||||
"requirements",
|
||||
remotefilelog=str("remotefilelog" in repo.requirements).lower(),
|
||||
)
|
||||
|
||||
try:
|
||||
if util.safehasattr(repo, "requirements"):
|
||||
ui.log(
|
||||
"requirements",
|
||||
generaldelta=str("generaldelta" in repo.requirements).lower(),
|
||||
)
|
||||
ui.log(
|
||||
"requirements",
|
||||
remotefilelog=str("remotefilelog" in repo.requirements).lower(),
|
||||
)
|
||||
|
||||
maxrss = util.getmaxrss()
|
||||
|
||||
# Log maxrss from within the hg process. The wrapper logs its own
|
||||
# value (which is incorrect if chg is used) so the column is
|
||||
# prefixed.
|
||||
ui.log("command_info", hg_maxrss=maxrss)
|
||||
except NotImplementedError:
|
||||
pass
|
||||
except Exception as e:
|
||||
ui.log("command_info", sampling_failure=e.message)
|
||||
|
||||
# Log other information that we don't want to log in the wrapper, if it's
|
||||
# cheap to do so.
|
||||
|
Loading…
Reference in New Issue
Block a user