homepage Welcome to WebmasterWorld Guest from 54.197.183.230
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
what causes broken pipe?
newbies

10+ Year Member



 
Msg#: 1049 posted 8:37 am on Apr 26, 2004 (gmt 0)

Hi all,

I have a program which querys a romote database and distribute results thrugh email to users. I have been using it for quite a while. Recently it stopped working. When I ran it under shell I got broken pipe error after it has run about 2 min, but if I run it as root, it can run much longer (20 min) but still got broken pipe. I wonder what are causes of broken pipe?

I know that you can set up a time limit for user's process, if a process runs longer than the limit, it will get killed. Is the broken pipe the case?

thank you for your help.

 

Duckula

10+ Year Member



 
Msg#: 1049 posted 9:44 am on Apr 26, 2004 (gmt 0)

Use the search feature in this site, I already kinda answered that (what causes broken pipe?):

How to use tar for backing up the entire site...
[webmasterworld.com]

In your particular case you seem to have some kind of race condition. See what processes are involved in the race (which one "wins" the race and should have waited for the other one) through pstree or something. Then find a way to delay the winner or make it play nice with the other.

SeanW

10+ Year Member



 
Msg#: 1049 posted 1:01 pm on Apr 26, 2004 (gmt 0)

A race condition is something else... It's when a non-atomic set of actions can be intercepted to affect the behaviour of the application. For instance, if I check for the existence of a file, and then create it if it doesn't exist, the time between the stat and the open is the race condition.

A broken pipe is like you said, except that it's specifically the input side of the pipe going away. ie, if you pump a bunch of data through more, and kill off more halfway through, the output side loses the file descriptor and gets killed with SIGPIPE.

Sean

Duckula

10+ Year Member



 
Msg#: 1049 posted 4:03 pm on Apr 26, 2004 (gmt 0)

Hm, got them confused...

newbies

10+ Year Member



 
Msg#: 1049 posted 4:42 pm on Apr 26, 2004 (gmt 0)

I am confused too.

How do you set up the time limit for which a user can run a process? I want to check that if it's the problem.

My program basically do two things, searching remote database and retrieving the results; sending results by email. Which process could be broken? The strange thing is the time before the pipe is broken is different for a user and a root user, with the latter being able to run the program much longer.

Duckula

10+ Year Member



 
Msg#: 1049 posted 5:36 pm on Apr 26, 2004 (gmt 0)

If my memory doesn't fail me (again) that's reported using 'ulimit -a' (as root). Maybe you want the "cpu time" value.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved