We're using gevent
in a long-lived Python process, and over time we spawn thousands upon thousands of Greenlets.
We're not joining any of these Greenlets; we just spawn-and-forget. (The Greenlet tasks themselves are short-lived and do exit.) Is that all right? Are we leaking any resources by not joining the Greenlets?
You are not leaking resources in the sense that all the used memory will be properly cleaned up when the greenlet dies (and the garbage collection happens, which is automatic). So I would not worry about that.
Of course, your description of your architecture does not make it appear very robust. So while you do not leak memory per se, if you really start too many greenlets, you might find that your main greenlet executes vey rarely. In other words, whenever it yields to the hub (via sleep or any other blocking call), you might find that thousands of greenlets are called and executed before your main greenlet comes back to life.
Also be aware of the overhead of switching back and forth between the hub and the greenlets.