[Zope-dev] file descriptors on Solaris [SUMMARY]

John Ziniti jziniti@speakeasy.org
Tue, 02 Oct 2001 14:50:32 -0400


I'd just like to summarize for the list some additional findings,
questions and clarifications.  

DIAGNOSIS:
It appears that this only happens when the form is specified with
"enctype=multipart/form-data".  In that case, Zope (or, more accurately,
the cgi module), tries to create temporary file for each form <input>,
no matter what type the input has ... (I think but I can't be 100%
sure about that).  This seems a little weird.  Why do we have to open
a file for each "part" just because it *may* contain a file?

PROGNOSIS:
The problem (on Solaris) is not very easy to fix, since it lies in the
system-wide definition of a file descriptor, which uses only one byte
to store the fd value (i.e., anything higher than 256 is meaningless,
and truncated??).  Changing this struct is not easy.  The problem is
not that Zope is exceeding the *allowed* number of FD's (usually
policed by the shell), but that Zope is exceeding the *meaningful*
number of FD's. This sucks. :-)

SUMMARY:
If you're planning on using large forms in Zope on Solaris (version??),
you'll have to move your file uploads to another page, since specifying
"multipart/form-data" causes cgi.py to open a tempfile.TemporaryFile for
each input on the form, which causes problems if the number of inputs
is greater than the file descriptor address space.