Your message dated Mon, 24 Aug 2009 18:47:05 +0000
with message-id <[email protected]>
and subject line Bug#542291: fixed in bip 0.8.2-1
has caused the Debian Bug report #542291,
regarding bip: Patch to handle disruptively slow clients
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
542291: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542291
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: bip
Version: 0.8.1-1
Severity: normal
Tags: patch

commit 94d6a02407f260f78f4f9276080e8413ff77ff89
Author: Zygo Blaxell <[email protected]>
Date:   Tue Aug 18 12:56:43 2009 -0400

We can't loop forever waiting for a slow client because the upstream
IRC server will drop our connection.

We can't send a partial message because it will corrupt the data stream.

We can't defer a partial message easily.  This could be done by passing
an extra return value from _write_sock() to its caller, or by letting
_write_sock() manipulate the connection's outgoing message queue directly.

If a downstream client is on the wrong end of a slow connection which
is just good enough to prevent TCP connections from resetting but not
good enough to keep up with the bandwidth demands of IRC, we can end up
in a situation where that downstream client causes failure of the proxied
IRC session.

So, if write() returns EAGAIN or similar errors, retry 10 times, once
per second.  If the downstream client consumes a complete line of text
during those 10 seconds, we let them keep their connection--otherwise,
we drop the client.  Currently this is done within the _write_socket
function, so if multiple clients are having this problem we might block
too long and the upstream server will drop us.

Note that downstream client connection dropping can only happen if the
TCP socket to the downstream client is blocking, which means we have
already sent somewhere between 128K and 4096K of data to the client (the
TCP buffer size range on Linux), and the downstream client is consuming
less than one line (512 bytes max) per 10 seconds.

It would be nice to send an error message explaining why we are doing this
to the client, but that requires us to send even more data toward a client
that is causing problems for us by not keeping up with data already sent.

There is probably a similar issue with the SSL code, but I don't use
SSL so I don't know how bip behaves in those cases.

---

diff --git a/src/connection.c b/src/connection.c
index 77edd05..1c3d163 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -234,6 +234,7 @@ static int _write_socket(connection_t *cn, char *message)
        size_t tcount = 0;
        size_t p_tcount = 0;
        ssize_t count;
+       int error_count = 0;
 
        size = strlen(message);
        do {
@@ -250,8 +251,16 @@ static int _write_socket(connection_t *cn, char *message)
                        }
                        p_tcount = tcount;
                }
+               if (count < 0 &&
+                       (errno == EAGAIN || errno == EINTR || errno == 
EINPROGRESS)) {
+                       ++error_count;
+                       mylog(LOG_DEBUGVERB, "write(fd %d) : %s - try #%d", 
cn->handle,
+                                       strerror(errno), error_count);
+                       sleep(1);
+               }
        } while (count < 0 &&
-               (errno == EAGAIN || errno == EINTR || errno == EINPROGRESS));
+               (errno == EAGAIN || errno == EINTR || errno == EINPROGRESS) &&
+               error_count < 10);
 
 #if 0
        if (count <= 0 && tcount > 0)
@@ -272,6 +281,7 @@ static int _write_socket(connection_t *cn, char *message)
                if (cn_is_connected(cn)) {
                        mylog(LOG_DEBUGVERB, "write(fd %d) : %s", cn->handle,
                                        strerror(errno));
+                       connection_close(cn);
                        cn->connected = CONN_ERROR;
                }
                mylog(LOG_DEBUGVERB, "write : %s", strerror(errno));

-- System Information:
Debian Release: 5.0.2
  APT prefers stable
  APT policy: (500, 'stable'), (189, 'testing'), (179, 'unstable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30.1-zb64 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash



--- End Message ---
--- Begin Message ---
Source: bip
Source-Version: 0.8.2-1

We believe that the bug you reported is fixed in the latest version of
bip, which is due to be installed in the Debian FTP archive:

bip_0.8.2-1.diff.gz
  to pool/main/b/bip/bip_0.8.2-1.diff.gz
bip_0.8.2-1.dsc
  to pool/main/b/bip/bip_0.8.2-1.dsc
bip_0.8.2-1_amd64.deb
  to pool/main/b/bip/bip_0.8.2-1_amd64.deb
bip_0.8.2.orig.tar.gz
  to pool/main/b/bip/bip_0.8.2.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Arnaud Cornet <[email protected]> (supplier of updated bip package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 24 Aug 2009 19:20:53 +0200
Source: bip
Binary: bip
Architecture: source amd64
Version: 0.8.2-1
Distribution: unstable
Urgency: low
Maintainer: Arnaud Cornet <[email protected]>
Changed-By: Arnaud Cornet <[email protected]>
Description: 
 bip        - multiuser irc proxy with conversation replay and more
Closes: 542291
Changes: 
 bip (0.8.2-1) unstable; urgency=low
 .
   * New Upstream Version (Closes: #542291).
   * Fix debhelper 7 dependency version.
   * Add README.source
   * Bump standards-version, no change needed.
Checksums-Sha1: 
 bfc5b310ad9491a2415947faaf1fa0f0df5db61e 977 bip_0.8.2-1.dsc
 a75da8be7f9984e02b61916e6a7d658bb1da1375 208502 bip_0.8.2.orig.tar.gz
 aae045c2beb140eb1d587ae75ff9519c86ca7319 7305 bip_0.8.2-1.diff.gz
 235906d1a7e6aa0ad38fcf548008f31abb2df11a 145338 bip_0.8.2-1_amd64.deb
Checksums-Sha256: 
 65c8f8860fda893270746c161b8ecb59eca23b42ddb13874f56ec6fa008b872c 977 
bip_0.8.2-1.dsc
 3367f4e6a3a352fd756db478d4a92378e370318a4c961ae03b0a1b40f46a1cfd 208502 
bip_0.8.2.orig.tar.gz
 5352b97534b7a0578ed0fd6636592417f208e8d90a905af6c25cc2cb8564050b 7305 
bip_0.8.2-1.diff.gz
 0234c8b053b9757b28b7f9bc0de790fff8241b51173ddd221cfa35d0bc2ddcc8 145338 
bip_0.8.2-1_amd64.deb
Files: 
 8025625d5bb76f588face7458153af65 977 net optional bip_0.8.2-1.dsc
 3f3a66f6179456ba7efb1970a89f46dd 208502 net optional bip_0.8.2.orig.tar.gz
 a95eaa2df363cece86d08b704543f0f2 7305 net optional bip_0.8.2-1.diff.gz
 595652af2de96c8af13902e6294d0c6a 145338 net optional bip_0.8.2-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqS3sIACgkQsk+dgCIlhI5npgCgwcs7cXwV2z5g60+JI0mV/X9m
2IEAn2fTY71TlyAA6jRa6eTHS7ln4XUK
=QUvp
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to