Skip to content

Conversation

@dougbu
Copy link
Contributor

@dougbu dougbu commented Jul 20, 2019

  • move from deprecated Get-WmiObject to Get-CimInstance

@@ -3,7 +3,7 @@ Set-Location $args[0]
$timestamp = $(get-date -f MM-dd-HH-mm)

while ($true) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dougbu Does this run every during the build to help diagnose hangs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Have a look at the log artifacts for the Windows jobs. Since the file is repeatedly overwritten, it should end with the list of processes just before AzDO gives up on us. Just a little something @JunTaoLuo cooked up 😃

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! We need it cross plat as well 😄

@davidfowl
Copy link
Member

Just took a look at the output, I have a few suggestions on how to improve this:

  • Replace the file with the previous one, it's not useful (IMO) to have historical data for what processes were running.
  • We should print the command line arguments to the process so it's easier to tell what was running at the time.

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName                                                  
-------  ------    -----      -----     ------     --  -- -----------                                                  
    532      40    37692      58100       2.39   1064   1 Agent.Listener                                               
    789      50    34804      59356       3.63   4576   1 Agent.PluginHost                                             
    570      44    48296      70192      12.22   8116   1 Agent.Worker                                                 
    305      18     8672      25588       0.22    468   1 ApplicationFrameHost                                         
    199      10     1996      10620       0.03    848   1 browser_broker                                               
     88       5     3532       4152       0.02   4936   1 cmd                                                          
     99       7     3624       4736       8.19   6956   1 cmd                                                          
     71       5     2496       3748       0.02   8388   1 cmd                                                          
    120       7     6440      10448       0.11   1400   0 conhost                                                      
    116       8     6512      10836       0.05   2240   1 conhost                                                      
    119       7     6424      10388       0.03   3448   0 conhost                                                      
    144       9     6620      11880       0.69   4480   0 conhost                                                      
    116       8     3032       7456       0.05   4588   1 conhost                                                      
    123       8     6520      10800       3.77   7736   1 conhost                                                      
    119       8     6504      10724       0.03   7872   1 conhost                                                      
    196      12     7136      17364       0.28   8396   1 conhost                                                      
    116       8     6512      10832       0.03   8540   1 conhost                                                      
    119       8     6524      10672       0.02   8596   1 conhost                                                      
    116       8     6512      10828       0.03   8680   1 conhost                                                      
    119       7     6440      10444       0.06   9080   0 conhost                                                      
    590      22     1744       5184       1.41    528   0 csrss                                                        
    633      19     1780       5236       5.64    612   1 csrss                                                        
    386      16     4456      16088       1.41   2904   1 ctfmon                                                       
    140      10    14672      14096       0.06   1928   1 dhandler                                                     
    137       8     2184       8252       0.31    912   1 dllhost                                                      
    710      34    33460      58424       1.78    900   1 dwm                                                          
   1703      65    28572      94348      20.98   5576   1 explorer                                                     
     49       6     1424       3680       0.08    928   0 fontdrvhost                                                  
     49       7     2116       5948       0.23    936   1 fontdrvhost                                                  
    447      31    17228      33516      10.97   9068   0 GenevaMonExtHealthMonitor                                    
      0       0       56          8                 0   0 Idle                                                         
    276      16     6732      14244       0.31   3320   0 IpOverUsbSvc                                                 
   1362      23     7276      18388      24.39    772   0 lsass                                                        
      0       0      288       2636       4.64   2324   0 Memory Compression                                           
   1055      51    51280        204       1.98   9012   1 Microsoft.Photos                                             
    924      75    22816      48388       0.61   7812   1 MicrosoftEdge                                                
    493      20     5900      21648       0.16   6492   1 MicrosoftEdgeCP                                              
    267      13     3980      11168       0.09   4760   1 MicrosoftEdgeSH                                              
    132       8     1688       7312       0.08   2224   0 MonAgentHost                                                 
    181      17     5092      13336       0.70   7780   0 MonAgentManager                                              
    676      61    70096     103596      31.47    944   1 MSBuild                                                      
    635      55    71220     104868      44.42   6052   1 MSBuild                                                      
    564      52    50368      74520      48.02   7124   1 MSBuild                                                      
    770      54    64224      96572      32.75   7380   1 MSBuild                                                      
    210      10     6636      10156       0.06   5980   0 msiexec                                                      
    680      65   173536     185040   1,037.06   3508   0 MsMpEng                                                      
     81       9     4856       7228       4.42   5296   1 mspdbsrv                                                     
    200      11    12716      16444       6.00   4112   0 NisSrv                                                       
    678      43    18132      56564       1.70   5564   1 OneDrive                                                     
    621      47    78520      91680       6.28   1168   1 powershell                                                   
    852      38    80644     103372       5.31   3844   1 powershell                                                   
    578      41    98512     114088       6.48   7128   1 powershell                                                   
    147      11     5756      12200       0.31   8460   1 python                                                       
    175      21    16380      25560      39.72   8728   1 python                                                       
    256      25    22800      33876      94.23   8736   1 python                                                       
      0      12      628      65212       2.00     96   0 Registry                                                     
    268      15     5480      22580       0.31   1568   1 RuntimeBroker                                                
    221      11     2304      11984       2.17   1648   1 RuntimeBroker                                                
    152       8     2124       8776       0.09   4668   1 RuntimeBroker                                                
    335      18    19820      32704       7.31   6596   1 RuntimeBroker                                                
    485      22     7600      33140       8.09   7008   1 RuntimeBroker                                                
    230      12     2728      13180       0.16   7760   1 RuntimeBroker                                                
    339      17     8560      26712       0.41   8764   1 RuntimeBroker                                                
    666      55    30820      43592      12.77   3272   0 SearchIndexer                                                
   1115      69    67944      72256      12.89   6544   1 SearchUI                                                     
    403      16     4332      15388       0.44    504   0 SecurityHealthService                                        
    150       9     1712       8448       0.05   2004   1 SecurityHealthSystray                                        
    656      11     4528       9312      48.95    748   0 services                                                     
     85       6     2860       5736       0.19   8308   0 SgrmBroker                                                   
    710      31    27672      67096       7.59   5284   1 ShellExperienceHost                                          
    506      18     6744      27984      20.84   1204   1 sihost                                                       
   1116      94   113124        160      17.27   2996   1 SkypeApp                                                     
    145       8     1840        156       0.03    156   1 SkypeBackgroundHost                                          
    392      22     9384      24820       0.30   4912   1 smartscreen                                                  
     53       3      476       1188       0.17    412   0 smss                                                         
    486      25     6208      19212       0.66   3120   0 spoolsv                                                      
    280      10     2516       8632       6.86    436   0 svchost                                                      
    226      12     2364      11224       0.13    472   0 svchost                                                      
    210      11     2852      12640       4.67    856   0 svchost                                                      
     85       5      952       3936       0.00    884   0 svchost                                                      
   1174      21    12964      29364      18.13    904   0 svchost                                                      
   1164      16     7372      13636      35.53   1020   0 svchost                                                      
    568      20     5084      13064       2.23   1108   0 svchost                                                      
    117       7     1300       5420       0.03   1224   0 svchost                                                      
    154       7     1444       5908       0.11   1232   0 svchost                                                      
    203      12     2528      10316       0.20   1288   0 svchost                                                      
    153       9     2092      11508       0.69   1300   0 svchost                                                      
    385      17     5948      15224       1.95   1352   0 svchost                                                      
    446      14    16692      19892       2.13   1388   0 svchost                                                      
    375      14     4204      11712       0.25   1396   0 svchost                                                      
    154      10     2004       7592      15.92   1504   0 svchost                                                      
    132       8     1496       6208       0.08   1516   0 svchost                                                      
    151      26     4800       8908       0.78   1524   0 svchost                                                      
    234      11     2432       7620       0.14   1536   0 svchost                                                      
    120       8     1476       6068       0.09   1544   0 svchost                                                      
    127       8     1488       6152       1.13   1560   0 svchost                                                      
    264      14     3020      13004       0.67   1596   0 svchost                                                      
    133       8     1568       6808       0.02   1672   0 svchost                                                      
    608      30     8340      33544       1.42   1680   1 svchost                                                      
    213       9     2156       7532       1.14   1784   0 svchost                                                      
    177      10     1692       7540       0.08   1896   0 svchost                                                      
    279      10     2580       9848       1.33   1912   0 svchost                                                      
    190       9     1596       6688       0.05   2160   0 svchost                                                      
    169       9     1948       7688       0.25   2172   0 svchost                                                      
    198       7     1368       5684       0.66   2200   0 svchost                                                      
    226      11   109660     119740   1,333.23   2208   0 svchost                                                      
    154       9     1740       7700       0.16   2344   0 svchost                                                      
    224      13     2788       7836       2.75   2360   0 svchost                                                      
    341      10     2672       8448       1.66   2412   0 svchost                                                      
    189      11     2032       8156       0.16   2452   0 svchost                                                      
    144       9     1520       6952       0.05   2460   0 svchost                                                      
    169      10     1896       7868       0.11   2472   0 svchost                                                      
    219      10     2004       8444       0.16   2652   0 svchost                                                      
    265      15     2548       9960       0.06   2688   0 svchost                                                      
    189      10     2104       7296       2.19   2756   0 svchost                                                      
    130       9     1596       6328       0.14   2840   0 svchost                                                      
    334      11     2160       8868       0.19   2856   0 svchost                                                      
    237      13     2412      13300       0.11   3000   0 svchost                                                      
    170       9     1784       7628       0.06   3084   0 svchost                                                      
    462      33    10212      22800       3.03   3144   0 svchost                                                      
    264      30     3652      13224       0.63   3296   0 svchost                                                      
    476      14     8704      18180      21.70   3304   0 svchost                                                      
    333      18    28620      37292       8.50   3328   0 svchost                                                      
    143       8     1328       5656       0.03   3336   0 svchost                                                      
    213      12     1844       7476       0.73   3348   0 svchost                                                      
    513      24    13748      28340       5.47   3356   0 svchost                                                      
    260      13     4108      16108       0.56   3364   1 svchost                                                      
    395      18     5844      26032       2.81   3432   1 svchost                                                      
    213      12     2704       9984       0.20   3500   0 svchost                                                      
    383      19     4648      20860       0.72   3576   0 svchost                                                      
    108       7     1292       5396       0.03   3636   0 svchost                                                      
    475      15     3368      11800       0.23   3652   0 svchost                                                      
    208      11     2236       8720       0.41   3836   0 svchost                                                      
    281      16     4112      19308       0.78   3984   0 svchost                                                      
    187       9     5844      14136      31.78   4460   0 svchost                                                      
    126       7     1312       6020       0.06   4768   0 svchost                                                      
    268      15     4792      15768       0.94   4952   0 svchost                                                      
    275      17     3756      15176       0.16   5192   0 svchost                                                      
    185      10     2124       8744       0.53   5624   0 svchost                                                      
    140       8     1716       7008       0.05   5732   0 svchost                                                      
    612      24    12416      23064      20.66   6112   0 svchost                                                      
    154       9     1704       7348       0.08   6152   0 svchost                                                      
    185      10     3968       8340       0.25   6432   0 svchost                                                      
    205      14     1904       7312       0.09   6616   0 svchost                                                      
    233      12     2548      14924       0.11   6856   1 svchost                                                      
    358      18     4492      18012       0.28   8696   0 svchost                                                      
    213      11     2372       9116       0.13   8848   0 svchost                                                      
    413      19     3836      17776       0.20   9028   0 svchost                                                      
    121       8     1520       5724       0.02   9124   0 svchost                                                      
   2807       0      192        156     458.73      4   0 System                                                       
    317      18     5328      15880       0.17   5016   1 taskhostw                                                    
    310      28     6444      16560       1.50   6028   1 taskhostw                                                    
    351      50   120548     110132      17.97    868   1 VBCSCompiler                                                 
    169      12     3440      11272       0.58   4472   0 VFPlugin                                                     
    146       9     1688       7728       0.08   1984   0 VSSVC                                                        
    833      48    46584      74020      16.78   3312   0 WaAppAgent                                                   
    116       6     1568       5760       0.08   8028   0 WaSecAgentProv                                               
    105       6     1260       5292       0.03   5376   0 Windows.WARP.JITService                                      
    626      47    42244      69764      95.09   3376   0 WindowsAzureGuestAgent                                       
    125       9     2284       7756       0.03   3420   0 WindowsAzureNetAgent                                         
    734      38    61188      62244      11.78   3488   0 WindowsAzureTelemetryService                                 
    168      11     1368       6788       0.06    604   0 wininit                                                      
    274      12     2632      11564       0.23    668   1 winlogon                                                     
    280      16     6808      16612       4.20   3852   0 WmiPrvSE                                                     
    623      29    11072        336       0.58   2784   1 YourPhone                                                    

It would be great to see the msbuild arguments etc.

@JunTaoLuo
Copy link
Contributor

Hmm I'm surprised the command line isn't being captured, especially since I specified Get-WmiObject Win32_Process | select name, processid, commandline. Maybe it's different with the Get-CimInstance API?

@dougbu
Copy link
Contributor Author

dougbu commented Jul 21, 2019

@davidfowl there are two files which are repeatedly overwritten; no historical data is saved -- just the last list before the PowerShell job is canceled.

The second file is named runningProcessesCommandLine.$timestamp.txt and it's found in the same artifacts folder as the runningProcesses.$timestamp.txt file you reviewed. That one lists the process name, id, and command line.

@dougbu
Copy link
Contributor Author

dougbu commented Jul 21, 2019

For this build, the https://dev.azure.com/dnceng/_apis/resources/Containers/1977117?itemPath=Windows_Logs%2FrunningProcessesCommandLine.07-20-19-20.txt file starts with:


name                             processid commandline                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
----                             --------- -----------                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
System Idle Process                      0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
System                                   4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
Registry                                96                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
smss.exe                               412                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
csrss.exe                              524                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
wininit.exe                            600                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
csrss.exe                              608                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
winlogon.exe                           688 winlogon.exe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
services.exe                           744                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
lsass.exe                              752 C:\Windows\system32\lsass.exe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
svchost.exe                            880 C:\Windows\system32\svchost.exe -k DcomLaunch -p -s PlugPlay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
svchost.exe                            904 C:\Windows\system32\svchost.exe -k DcomLaunch -p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
fontdrvhost.exe                        920 "fontdrvhost.exe"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
fontdrvhost.exe                        928 "fontdrvhost.exe"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
svchost.exe                            368 C:\Windows\system32\svchost.exe -k RPCSS -p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
svchost.exe                            420 C:\Windows\system32\svchost.exe -k DcomLaunch -p -s LSM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
dwm.exe                                500 "dwm.exe"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
svchost.exe                           1100 C:\Windows\System32\svchost.exe -k NetworkService -s TermService                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

@JunTaoLuo the Get-WmiObject and Get-CimInstance commands show the same information as far as I can tell.

@davidfowl oops, I didn't notice @JunTaoLuo left the previous files around. I'd prefer to keep at most two files around (just in case AzDO starts killing processes before the process dump last runs). @JunTaoLuo why did you keep many more files around?

@dougbu
Copy link
Contributor Author

dougbu commented Jul 21, 2019

@davidfowl @JunTaoLuo jobs write up to 9 copies of each process dump file because

multiple files … correspond to multiple '.\build.ps1' invocations

Since we never run .\build.ps1 processes in parallel, I lean toward removing the $timestamp portion of the filenames. But, do either of you see the existing file list as necessary for some scenarios?

@dougbu
Copy link
Contributor Author

dougbu commented Jul 21, 2019

BTW @davidfowl I'm not writing a dump_process.sh script in this PR though we have definitely seen hangs on macOS. Hangs have mostly occurred on Windows.

For later use, I suspect ps ax -f --width 800 is the one process dump command we'd need on Linux and macOS. Can you confirm that runs fine on macOS?

@dougbu
Copy link
Contributor Author

dougbu commented Jul 22, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@dougbu
Copy link
Contributor Author

dougbu commented Jul 22, 2019

/azp run AspNetCore-ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dougbu
Copy link
Contributor Author

dougbu commented Jul 22, 2019

/azp run AspNetCore-ci

@dougbu dougbu marked this pull request as ready for review July 22, 2019 17:23
@dougbu dougbu requested a review from a team as a code owner July 22, 2019 17:23
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Pilchie Pilchie added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jul 22, 2019
@dougbu
Copy link
Contributor Author

dougbu commented Jul 23, 2019

Bump @davidfowl @JunTaoLuo

Copy link
Contributor

@JunTaoLuo JunTaoLuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No good reason for keeping the files around. I just didn't add any logic for handling it.

@dougbu
Copy link
Contributor Author

dougbu commented Jul 24, 2019

I just didn't add any logic for handling it.

My plan to handle it was just to remove the $timestamp from the filenames. Am I missing something?

@JunTaoLuo
Copy link
Contributor

As long as the latest file is around, it sounds good to me.

dougbu added 5 commits July 25, 2019 20:38
- move from deprecated `Get-WmiObject` to `Get-CimInstance`
- multiple files created today correspond to multiple '.\build.ps1' invocations
- no need to keep files from previous ./build.ps1 invocations around
- by definition, job isn't hung if it can move to next build step
@dougbu dougbu force-pushed the dougbu/dump.more branch from 5d35111 to 184a5b5 Compare July 26, 2019 03:43
@dougbu dougbu merged commit 922baf9 into master Jul 26, 2019
@ghost ghost deleted the dougbu/dump.more branch July 26, 2019 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants