{"id":483,"date":"2014-07-17T07:00:00","date_gmt":"2014-07-17T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2014\/07\/17\/what-does-it-mean-when-getqueuedcompletionstatus-return-error_sem_timeout\/"},"modified":"2014-07-17T07:00:00","modified_gmt":"2014-07-17T07:00:00","slug":"what-does-it-mean-when-getqueuedcompletionstatus-return-error_sem_timeout","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20140717-00\/?p=483","title":{"rendered":"What does it mean when GetQueuedCompletionStatus return ERROR_SEM_TIMEOUT?"},"content":{"rendered":"<p>A customer asked for assistance interpreting a failure of the <code>Get&shy;Queued&shy;Completion&shy;Status<\/code> function.<\/p>\n<blockquote class=\"q\"><p>  We are observing that <code>Get&shy;Queued&shy;Completion&shy;Status<\/code> is intermittently behaving as follows: <\/p>\n<ul>\n<li>The handle is a <code>SOCKET<\/code>. <\/li>\n<li>The function returns <code>FALSE<\/code>. <\/li>\n<li><code>lpOverlapped != NULL<\/code>. <\/li>\n<li><code>Get&shy;Last&shy;Error<\/code> reports     <code>ERROR_SEM_TIMEOUT<\/code>:     &#8220;The semaphore timeout period has expired.&#8221; <\/li>\n<\/ul>\n<p> That&#8217;s all the information we have in our log files. We don&#8217;t know the value of <code>number&shy;Of&shy;Bytes<\/code> or <code>completion&shy;Key<\/code>, sorry. <\/p>\n<p> We realize that this is a rather vague question, but when this problem hits our machines, it causes our internal logic to go into a reset state since it doesn&#8217;t know what the error means or how to recover. Resetting is expensive, and we would prefer to handle this error in a less drastic manner, if only we knew what it meant. <\/p>\n<\/blockquote>\n<p> The error code <code>ERROR_SEM_TIMEOUT<\/code> is a rather bad translation of the underlying status code <code>STATUS_IO_TIMEOUT<\/code>, which is much more meaningful. It means that the I\/O operation timed out.\n Colleagues of mine from the networking team chimed in with additional information:\n A common source of this error with TCP sockets is that the <a href=\"http:\/\/support.microsoft.com\/kb\/170359\"> maximum retransmission count and timeout have been reached<\/a> on a bad (or broken) link.<\/p>\n<p> If you know that the handle is a socket, then you can use <code>WSA&shy;Get&shy;Overlapped&shy;Result<\/code> on the <code>lpOverlapped<\/code> that got returned. Winsock will convert the status code to something more Winsocky. In this case, it would have given you <code>WSA&shy;ETIMED&shy;OUT<\/code>, which makes it clearer what happened. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A customer asked for assistance interpreting a failure of the Get&shy;Queued&shy;Completion&shy;Status function. We are observing that Get&shy;Queued&shy;Completion&shy;Status is intermittently behaving as follows: The handle is a SOCKET. The function returns FALSE. lpOverlapped != NULL. Get&shy;Last&shy;Error reports ERROR_SEM_TIMEOUT: &#8220;The semaphore timeout period has expired.&#8221; That&#8217;s all the information we have in our log files. We don&#8217;t [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-483","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>A customer asked for assistance interpreting a failure of the Get&shy;Queued&shy;Completion&shy;Status function. We are observing that Get&shy;Queued&shy;Completion&shy;Status is intermittently behaving as follows: The handle is a SOCKET. The function returns FALSE. lpOverlapped != NULL. Get&shy;Last&shy;Error reports ERROR_SEM_TIMEOUT: &#8220;The semaphore timeout period has expired.&#8221; That&#8217;s all the information we have in our log files. We don&#8217;t [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=483"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/483\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}