<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Gevent on 不会跑</title>
    <link>https://buhuipao.github.io/tags/gevent/</link>
    <description>Recent content in Gevent on 不会跑</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Mon, 03 Apr 2017 09:18:45 +0000</lastBuildDate>
    <atom:link href="https://buhuipao.github.io/tags/gevent/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>果然我也遇到了gevent.hub.LoopExit的报错了</title>
      <link>https://buhuipao.github.io/2017/04/03/%E6%9E%9C%E7%84%B6%E6%88%91%E4%B9%9F%E9%81%87%E5%88%B0%E4%BA%86gevent-hub-loopexit%E7%9A%84%E6%8A%A5%E9%94%99%E4%BA%86/</link>
      <pubDate>Mon, 03 Apr 2017 09:18:45 +0000</pubDate>
      <guid>https://buhuipao.github.io/2017/04/03/%E6%9E%9C%E7%84%B6%E6%88%91%E4%B9%9F%E9%81%87%E5%88%B0%E4%BA%86gevent-hub-loopexit%E7%9A%84%E6%8A%A5%E9%94%99%E4%BA%86/</guid>
      <description>&lt;p&gt;报错信息如下：&lt;/p&gt;&#xA;&lt;p&gt;gevent.hub.LoopExit: (‘This operation would block forever’, &amp;lt;Hub at 0x1076b7e10 select default pending=0 ref=0 resolver=&amp;lt;gevent.resolver_thread.Resolver at 0x1077eec90 pool=&amp;lt;ThreadPool at 0x1077eecd0 0/10/10&amp;raquo; threadpool=&amp;lt;ThreadPool at 0x1077eecd0 0/10/10&amp;raquo;)&lt;/p&gt;&#xA;&lt;h3 id=&#34;原因分析&#34;&gt;原因分析&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;gevent.hub.LoopExit&lt;/code&gt; 这个异常的含义是：&lt;strong&gt;当前没有任何可以运行的 greenlet，但有操作正在等待完成&lt;/strong&gt;。换句话说，所有的 greenlet 都在等待 I/O 或者已经结束了，event loop 中已经没有活跃的事件源（ref=0），此时如果还有代码试图做阻塞操作（比如 &lt;code&gt;queue.get()&lt;/code&gt;），gevent 就会抛出这个异常，因为它知道这个等待永远不会有结果。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
