1 |
jsbronder 08/08/04 23:17:12 |
2 |
|
3 |
Added: ganglia-3.1-gmond-python-tcpconn-concurrency.patch |
4 |
Log: |
5 |
Version bump, thanks to Carlo Marcelo Arenas Belon for help with the ebuild. #233440 |
6 |
(Portage version: 2.1.4.4) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 sys-cluster/ganglia/files/ganglia-3.1-gmond-python-tcpconn-concurrency.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/ganglia/files/ganglia-3.1-gmond-python-tcpconn-concurrency.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/ganglia/files/ganglia-3.1-gmond-python-tcpconn-concurrency.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: ganglia-3.1-gmond-python-tcpconn-concurrency.patch |
15 |
=================================================================== |
16 |
Index: gmond/python_modules/network/tcpconn.py |
17 |
=================================================================== |
18 |
--- gmond/python_modules/network/tcpconn.py (revision 1622) |
19 |
+++ gmond/python_modules/network/tcpconn.py (working copy) |
20 |
@@ -245,19 +245,14 @@ |
21 |
tempconns[conn] = 0 |
22 |
|
23 |
#Call the netstat utility and split the output into separate lines |
24 |
- fd_poll = select.poll() |
25 |
- self.popenChild = popen2.Popen3("netstat -t -a") |
26 |
- fd_poll.register(self.popenChild.fromchild) |
27 |
+ self.popenChild = popen2.Popen3("netstat -t -a -n") |
28 |
+ lines = self.popenChild.fromchild.readlines() |
29 |
|
30 |
- poll_events = fd_poll.poll() |
31 |
- |
32 |
- if (len(poll_events) == 0): # Timeout |
33 |
- continue |
34 |
- |
35 |
- for (fd, events) in poll_events: |
36 |
- lines = self.popenChild.fromchild.readlines() |
37 |
- |
38 |
- self.popenChild.wait() |
39 |
+ try: |
40 |
+ self.popenChild.wait() |
41 |
+ except OSError, e: |
42 |
+ if e.errno == 10: # No child process |
43 |
+ continue |
44 |
|
45 |
#Iterate through the netstat output looking for the 'tcp' keyword in the tcp_at |
46 |
# position and the state information in the tcp_state_at position. Count each |
47 |
@@ -300,7 +295,8 @@ |
48 |
_glock.release() |
49 |
|
50 |
#Wait for the refresh_rate period before collecting the netstat data again. |
51 |
- time.sleep(_refresh_rate) |
52 |
+ if not self.shuttingdown: |
53 |
+ time.sleep(_refresh_rate) |
54 |
|
55 |
#Set the current state of the thread after a shutdown has been indicated. |
56 |
self.running = False |