Examine Kevin Wilson's Context agent Patch. #89

Open
oldpatricka opened this Issue Mar 26, 2012 · 1 comment

Comments

Projects
None yet
1 participant
Member

oldpatricka commented Mar 26, 2012

Kevin Wilson kindly provided a patch with the following explanation to the mailing list:

I first wrote to this list with a context agent problem in September 2011. (John offered his help, and although ultimately I became very busy and did not follow up, I am grateful.) My observations follow in brief.

I have a Debian 3.1r1 image running linux-2.4.27 and python-2.3.5. I copied the context agent directory from a working configuration, adjusted ctx-scripts, and attempted to start a cluster of these VMs. The context broker never heard from them. In ctxlog.txt on the VMs, I found that the output from the curl command that gets 'user-data' was truncated to 4096 bytes. I compiled python-2.6.6 and also saw the problem with that version.

I recently had some time. I tracked the source of the problem down to an assumption made about the size of Linux's pipe buffers, which are now very large. The pipe buffers in unmodified linux-2.4.xy versions were limited to no larger than the page size, 4096 bytes on x86. The context agent's Python code was waiting until after curl finished before reading from the stdout pipe created by popen2.Popen3, and curl itself was waiting for more room in the pipe buffer. Eventually the ctx-agent killed curl and read out incomplete data in the pipe.

I made minor changes to utils.py:SimpleRunThread.run() and I've attached a patch; I hope somebody finds it useful. Please consider adding this fix to the next ctx-agent release. The agent is indeed compatible with Python 2.3 as advertised, but the VMs that run such old Python versions are likely to have old kernels, as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment