{"id":5472,"date":"2019-07-23T23:16:38","date_gmt":"2019-07-24T04:16:38","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=5472"},"modified":"2019-07-24T10:29:56","modified_gmt":"2019-07-24T15:29:56","slug":"un-killable-process","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=5472","title":{"rendered":"Un-killable Process"},"content":{"rendered":"<p>Scott had a Dolphin instance veg out on him. Not much for it other than killing the process. Except it <em>didn&#8217;t<\/em> kill. Now SIGTERM (15) I don&#8217;t expect to kill a vegged out process, but SIGKILL (9)? I&#8217;ve never seen that fail. A little research later, and I&#8217;ve discovered &#8220;uninterruptible sleep&#8221;.\u00a0 Which, at 11PM is starting to sound <em>really<\/em> good to me. But not something I associate with computer programs. Essentially, processes that are waiting on I\/O very briefly pop into this state and pop out of the state when the I\/O operation completes. Code needs to have timeouts to prevent the application from getting <em>stuck<\/em> waiting for I\/O. And, evidently, Scott has discovered a scenario in which Dolphin does not have a timeout.<\/p>\n<p>How can you tell that your process is stuck in uninterruptible sleep? Use &#8220;ps u&#8221; (or &#8220;ps aux&#8221; for\u00a0<em>all<\/em> processes) and check the &#8220;STAT&#8221; column.<\/p>\n<p>From &#8220;man ps&#8221;:<\/p>\n<pre>PROCESS STATE CODES\r\nHere are the different values that the s, stat and state output\r\nspecifiers (header \"STAT\" or \"S\") will display to describe the state of\r\na process:\r\n\r\nD uninterruptible sleep (usually IO)\r\nI Idle kernel thread\r\nR running or runnable (on run queue)\r\nS interruptible sleep (waiting for an event to complete)\r\nT stopped by job control signal\r\nt stopped by debugger during the tracing\r\nW paging (not valid since the 2.6.xx kernel)\r\nX dead (should never be seen)\r\nZ defunct (\"zombie\") process, terminated but not reaped by its parent\r\n\r\nFor BSD formats and when the stat keyword is used, additional\r\ncharacters may be displayed:\r\n\r\n&lt; high-priority (not nice to other users)\r\nN low-priority (nice to other users)\r\nL has pages locked into memory (for real-time and custom IO)\r\ns is a session leader\r\nl is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)\r\n+ is in the foreground process group<\/pre>\n<p>Rebooting clears the process (or sorting whatever is blocking the I\/O operation). But there are processes that &#8220;kill -9&#8221; won&#8217;t terminate.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scott had a Dolphin instance veg out on him. Not much for it other than killing the process. Except it didn&#8217;t kill. Now SIGTERM (15) I don&#8217;t expect to kill a vegged out process, but SIGKILL (9)? I&#8217;ve never seen that fail. A little research later, and I&#8217;ve discovered &#8220;uninterruptible sleep&#8221;.\u00a0 Which, at 11PM is &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[294,654],"class_list":["post-5472","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-linux","tag-process-management"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5472"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5472\/revisions"}],"predecessor-version":[{"id":5473,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5472\/revisions\/5473"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}