From: Eric S. Raymond Date: Tue, 9 Oct 2012 00:27:07 +0000 (-0400) Subject: Remove eventlet support. X-Git-Tag: 1.10~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c33beb5b0986c3ddf2484d21dc440479273e6a70;p=irker.git Remove eventlet support. It seems to collide, hard, with the (necessary) library mutex. Also it was really complicating testing. --- diff --git a/hacking.txt b/hacking.txt index 253a2c6..d91dcdf 100644 --- a/hacking.txt +++ b/hacking.txt @@ -55,9 +55,6 @@ Subversion support in irkerhook.py. Georg Brandl contributed the Mercurial support in irkerhook.py and explained how to make Control-C work right. -Peter Scott contributed the original greenlet -support. - Laurent Bachelier fixed the Makefile so it wouldn't break stuff and wrote the first version of the external filtering option. diff --git a/install.txt b/install.txt index 05ac862..44a5aa5 100644 --- a/install.txt +++ b/install.txt @@ -28,12 +28,6 @@ You will need to have Jason Coombs's irc library where Python can see it. See ; use version 3.0, not the older code from SourceForge. -For higher performance, also install the eventlet library from -. This merges in a cooperative -threading implementation that is faster and has much lower space -overhead than system threads, making irkerd more resistant to -potential DoS attacks. - The file org.catb.irkerd.plist is a Mac OS/X plist that can be installed to launch irkerd as a boot-time service on that system. diff --git a/irkerd b/irkerd index 3005dbe..c55c0eb 100755 --- a/irkerd +++ b/irkerd @@ -38,31 +38,12 @@ UNSEEN_TTL = 60 # Time to live, seconds since first request CHANNEL_MAX = 18 # Max channels open per socket (default) ANTI_FLOOD_DELAY = 0.5 # Anti-flood delay after transmissions, seconds ANTI_BUZZ_DELAY = 0.09 # Anti-buzz delay after queue-empty check +CONNECTION_MAX = 200 # To avoid hitting a thread limit # No user-serviceable parts below this line version = "1.9" -# This black magic imports support for green threads (coroutines), -# then has kinky sex with the import library internals, replacing -# "threading" with a coroutine-using imposter. Threads then become -# ultra-light-weight and cooperatively scheduled. -try: - import eventlet - eventlet.monkey_patch() - green_threads = True - # With greenlets we don't worry about thread exhaustion, only the - # file descriptor limit (typically 1024 on modern Unixes). Thus we - # can handle a lot more concurrent sessions and generate less - # join/leave spam under heavy load. - CONNECTION_MAX = 1000 -except ImportError: - # Threads are more expensive if we have to use OS-level ones - # rather than greenlets. We need to avoid pushing thread limits - # as well as fd limits. See security.txt for discussion. - CONNECTION_MAX = 200 - green_threads = False - import sys, getopt, urlparse, time, random, socket import threading, Queue, SocketServer import irc.client, logging diff --git a/security.txt b/security.txt index 4bee577..8faf43f 100644 --- a/security.txt +++ b/security.txt @@ -163,10 +163,6 @@ near resource limits. An ordinary DoS attack would then be prevented from completely blocking all message traffic; the cost would be a whole lot of join/leave spam due to connection churn. -We also use greenlets (Python coroutines imitating system threads) -when they are available. This reduces memory overhead due to -threading substantially, making a thread-flooding DoS more dfficult. - == Authentication/Integrity == One way to help prevent DoS attacks would be in-band authentication -