Azure App Service: Získání full memory dumpu při výskytu určité výjimky

Opakovaně si libuji, co všechno je na Azure App Service z hlediska diagnostiky a správy možné ve srovnání s tradičním webhostingem. Například získat full memory dump je snadné, díky Kudu a SysInternals, které jsou na AppService k dispozici.

…no a pokud ladím konkrétní problém a potřebuji memory dump v momentu výskytu určité výjimky, je to už jenom o správném použití ProcDump ze SysInternals (spustit z Debug Console, kde si aktuální adresář přepnete třeba na LogFiles:


d:\devtools\sysinternals\procdump -accepteula -ma -e 1 -f "FaultException" 9736

…poslední číslo je číslo procesu (získáte z Kudu z Process Exploreru nebo z portálu), v uvozovkách stačí libovolná část názvu typu výjimky (testuje se přes Contains).

Celá věc pak může vypadat třeba takhle:


Kudu Remote Execution Console
Type 'exit' then hit 'enter' to get a new CMD process.
Type 'cls' to clear the console

Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

D:\home>
D:\home\LogFiles>d:\devtools\sysinternals\procdump -accepteula -ma -e 1 -f "FaultException" 9736

ProcDump v9.0 - Sysinternals process dump utility
Copyright (C) 2009-2017 Mark Russinovich and Andrew Richards
Sysinternals - www.sysinternals.com

Process: w3wp.exe (9736)
Process image: D:\Windows\SysWOW64\inetsrv\w3wp.exe
CPU threshold: n/a
Performance counter: n/a
Commit threshold: n/a
Threshold seconds: n/a
Hung window check: Disabled
Log debug strings: Disabled
Exception monitor: First Chance+Unhandled
Exception filter: [Includes]
*FaultException*
[Excludes]
Terminate monitor: Disabled
Cloning type: Disabled
Concurrent limit: n/a
Avoid outage: n/a
Number of dumps: 1
Dump folder: D:\home\LogFiles\
Dump filename/mask: PROCESSNAME_YYMMDD_HHMMSS
Queue to WER: Disabled
Kill after dump: Disabled

Press Ctrl-C to end monitoring without terminating the process.

CLR Version: v4.0.30319

[07:57:32] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:57:40] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:57:50] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:57:55] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:58:02] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:58:10] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:58:20] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:58:24] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:58:32] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:58:40] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:58:50] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:58:55] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:59:02] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:59:10] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:59:20] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:59:25] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:59:32] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:59:40] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:59:50] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:59:55] Exception: E0434F4D.System.Threading.ThreadAbortException ("Thread was being aborted.")
[07:59:59] Exception: E0434F4D.System.ServiceModel.FaultException ("The message with Action '' cannot be processed at the receive
r, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Acti
ons between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and recei
ver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).")
[07:59:59] Dump 1 initiated: D:\home\LogFiles\w3wp.exe_170829_075959.dmp
[08:00:04] Dump 1 writing: Estimated dump file size is 290 MB.
[08:00:11] Dump 1 complete: 290 MB written in 12.1 seconds
[08:00:12] Dump count reached.

D:\home\LogFiles>

1 thought on “Azure App Service: Získání full memory dumpu při výskytu určité výjimky

  1. Pingback: Diagnostika aplikací v Azure AppService – záznam a dema [TechEd Praha 05/2018] | HAVIT Knowledge Base

Zanechat odpověď

Vyplňte detaily níže nebo klikněte na ikonu pro přihlášení:

Logo WordPress.com

Komentujete pomocí vašeho WordPress.com účtu. Odhlásit /  Změnit )

Facebook photo

Komentujete pomocí vašeho Facebook účtu. Odhlásit /  Změnit )

Připojování k %s