Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] EbuildProcess logs poll-error to already removed $T (on AIX)
Date: Mon, 28 Mar 2011 15:57:45
Message-Id: 4D90AFC0.8090503@gentoo.org
In Reply to: Re: [gentoo-portage-dev] EbuildProcess logs poll-error to already removed $T (on AIX) by Michael Haubenwallner
1 On 03/28/2011 03:05 AM, Michael Haubenwallner wrote:
2 >
3 >
4 > On 03/25/2011 05:23 PM, Zac Medico wrote:
5 >>> * EbuildProcess received strange poll event: 16384
6 >
7 >> You can compare 16384 to the values of POLLERR and POLLNVAL in order to
8 >> see what type of event it is. Apparently the values on AIX are different
9 >> from those on Linux, because here's what I see on Linux:
10 >
11 > On AIX 5.3 this is:
12 >
13 > Python 2.7.1 (r271:86832, Feb 28 2011, 17:51:02)
14 > [GCC 4.2.4 (Gentoo 4.2.4-r01.2 p1.1)] on aix5
15 > Type "help", "copyright", "credits" or "license" for more information.
16 >>>> import select
17 >>>> dir(select)
18 > ['PIPE_BUF', 'POLLERR', 'POLLHUP', 'POLLIN', 'POLLMSG', 'POLLNVAL', 'POLLOUT',
19 > 'POLLPRI', 'POLLRDBAND', 'POLLRDNORM', 'POLLWRBAND', 'POLLWRNORM', '__doc__',
20 > '__file__', '__name__', '__package__', 'error', 'poll', 'select']
21 >>>> select.POLLNVAL
22 > 32768
23 >>>> select.POLLERR
24 > 16384
25
26 So, apparently POLLERR is the "strange poll event" that's being received.
27
28 > On AIX 6.1 it looks similar except for missing 'PIPE_BUF'.
29 >
30 >> This will handle the IOError:
31 >> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0a64f784003c11e151405b7f708d77770de0ed57
32 >
33 > Yes, that makes it work, thank you!
34 >
35 >> It might be risky to skip logging of the POLLNVAL / POLLERR events, so
36 >> hopefully we can determine their cause and handle them somehow. Do they
37 >> seem to cause any problems? It might be something specific about pty
38 >> devices on AIX.
39 >
40 > There doesn't seem to go anything wrong so far.
41
42 Maybe on AIX, POLLERR is essentially equivalent to POLLHUP in this case.
43 If that's true, then we could conditionally modify portage's
44 PollConstants class for AIX like this:
45
46 diff --git a/pym/_emerge/PollConstants.py b/pym/_emerge/PollConstants.py
47 index d0270a9..73a3908 100644
48 --- a/pym/_emerge/PollConstants.py
49 +++ b/pym/_emerge/PollConstants.py
50 @@ -1,6 +1,7 @@
51 # Copyright 1999-2009 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53
54 +import platform
55 import select
56 class PollConstants(object):
57
58 @@ -16,3 +17,8 @@ class PollConstants(object):
59 v *= 2
60 del k, v
61
62 +if platform.system() in ('AIX',):
63 + # Interpret POLLERR like POLLHUP.
64 + PollConstants.POLLHUP = \
65 + PollConstants.POLLHUP | PollConstants.POLLERR
66 + PollConstants.POLLERR = 0
67
68 Does platform.system() return "AIX" exactly as I spelled it?
69
70 > I've no idea about programming with pty devices at all.
71 > However, one relevant (IMHO) thing I can see is:
72 > portage/util/_pty.py:_can_test_pty_eof() returns True for Linux only.
73 >
74 > Anything I can try out?
75
76 You can check whether or not pty support is enabled in portage like this:
77
78 python -c 'import portage.util._pty, sys;
79 sys.stdout.write(str(portage.util._pty._disable_openpty))'
80
81 --
82 Thanks,
83 Zac

Replies