atom feed21 messages in org.python.tutor[Tutor] sockets, files, threads
FromSent OnAttachments
Marilyn DavisJan 13, 2005 2:04 am 
Danny YooJan 13, 2005 2:31 am 
Danny YooJan 13, 2005 2:41 am 
Marilyn DavisJan 13, 2005 3:17 am 
Danny YooJan 13, 2005 6:29 am 
Alan GauldJan 13, 2005 10:20 am 
Marilyn DavisJan 15, 2005 11:19 pm 
Marilyn DavisJan 16, 2005 3:12 am 
Marilyn DavisJan 16, 2005 6:47 am 
Danny YooJan 16, 2005 7:40 am 
Marilyn DavisJan 17, 2005 5:02 am 
Danny YooJan 18, 2005 10:51 am 
Danny YooJan 18, 2005 7:24 pm 
Marilyn DavisJan 19, 2005 2:32 am 
Danny YooJan 19, 2005 8:12 am 
Kent JohnsonJan 19, 2005 12:35 pm 
Marilyn DavisJan 19, 2005 8:57 pm 
Marilyn DavisJan 19, 2005 9:13 pm 
Danny YooJan 19, 2005 9:53 pm 
Marilyn DavisJan 19, 2005 10:28 pm 
Marilyn DavisJan 21, 2005 5:05 am 
Subject:[Tutor] sockets, files, threads
From:Marilyn Davis (mari@deliberate.com)
Date:Jan 13, 2005 2:04:42 am
List:org.python.tutor

Hello Tutors,

I've been banging my head against this bug for 4 days.

I can't think of how to ask for help except to give a birds eye view of the situation.

I have a python daemon that is listening on a UNIX socket for communication with exim, my Mail Transfer Agent.

Each mail message has its own exim process.

The exim process speaks to my daemon, who starts a thread which reads everything there is on the socket, and sends and 'OK' to send exim on its way. That exim process finishes quickly because that 'OK' means to dump the message, I am taking responsibility for it from here.

When stuff was read from the exim socket, it was stored in a tempfile, so that I could release the exim process, then I lseek to the front of the tempfile and have it handy. I see from all my debugging and logging that the file descriptor for this tempfile is 9.

The program then opens a pipe to exim to send mail. I see that the popen2.popen3 call returns 9 for the stdin file descriptor for the pipe.

The tempfile (also file descriptor 9) is read for piping into exim and it errors with "Bad file descriptor".

Worse yet, the first 5 messages of my test go through the entire process without a problem, and then # 6 hits this -- but only if # 1 message is really big.

I'm at a loss. Does anyone have an idea?