Fault Tolerant Shell 234
Paul Howe writes "Roaming around my school's computer science webserver I ran across what struck me as a great (and very prescient) idea: a fault tolerant scripting language. This makes a lot of sense when programming in environments that are almost fundamentally unstable i.e. distributed systems etc. I'm not sure how active this project is, but its clear that this is an idea whose time has come. Fault Tolerant Shell."
Python (Score:2, Offtopic)
Re:Python (Score:5, Insightful)
Try the Wing IDE [wingide.com]. It has most of the functions you wanted... But it's not free software.
Python already has that (Score:5, Informative)
Re:Python (Score:3, Informative)
You're dealing with the problem too high up (Score:5, Interesting)
The real benefit is in having a system which is sufficiently distributed that any program running on top of it can continue to do so despite any sort of underlying failure.
Re:You're dealing with the problem too high up (Score:5, Insightful)
IMHO as someone who works in a complex web server / database server environment, there are many interdependancies brought by different software, different platforms and different applications. Whilst 100% uptime on all servers is a nice to have, it's a complex goal to achieve and requires not just expertise in the operating systems & web / database server software but an indepth understanding of the applications.
A system such as this fault tolerant shell is actually quite a neat idea. It allows for flexibility in system performance and availability, without requiring complex (and therefore possibly error prone or difficult to maintain) management jobs. An example would be server which replicates images using rsync. If one of the targets is busy serving web pages or running another application, ftsh would allow for that kind of unforeseen error to be catered for relatively easily.
Re:You're dealing with the problem too high up (Score:3, Insightful)
It depends how you organise your systems. If you push to them then yes you need something like ftsh. If you organise them so that they pull updates, pull scripts to execute and arrange those scripts so that they fail safe (as they all should anyway) then you'll have something w
Re:You're dealing with the problem too high up (Score:3, Insightful)
Push doesn't scale. (Score:4, Informative)
Even here, pull scales better than push, look at a web server as an example thousands of machines sucking web pages from a server is not uncommon. Try pushing those pages out to the same number of machines.
Push methodologies simply don't scale, I've been there, done that and it's a bad architecture for more than trivial numbers of machines and I'm not the only one to notice:
http://www.infrastructures.org/bootstrap/pushpu
OT: Regarding your signature... (Score:3, Funny)
Does that mean they were (wait for it...) existentialists?
Re:You're dealing with the problem too high up (Score:4, Insightful)
Resources DO become unavailable in most systems. It simply doesn't pay to ensure everything is duplicated, and set up infrastructures that makes it transparent to the end user - there are almost always cheaper ways of meeting your business goals by looking at what level of fault tolerance you actually need.
For most people hours, sometimes even days, of outages can be tolerable for many of their systems, and minutes mostly not noticeable if the tools can handle it. The cost difference in providing a system where unavailabilities are treated as a normal, acceptable condition within some parameters, and one where failures are made transparent to the user can be astronomical.
To this date, I have NEVER seen a computer system that would come close to the transparency you are suggesting, simply beause for most "normal" uses it doesn't make economic sense.
Bad Idea (Score:5, Insightful)
Re:Bad Idea (Score:2, Interesting)
Re:Bad Idea (Score:5, Insightful)
Re:Bad Idea (Score:2)
Re:Bad Idea (Score:2, Insightful)
The only thing I can add at this point is an analogy:
Think of it along the lines of IE and HTML; if you don't want to close your tags, say your table td and tr tags, it's fine, the IE browser will do it for you.
Nevermind that it will break most any W3C compliant browser on the planet.
(insert deity here) help the person that gets used to this style of programming and then joins the real world.
Re:Bad Idea (Score:3, Interesting)
According to the HTML 4.01 spec [w3.org] </td> and </tr> tags are optional. So you can code a standards compliant page without them, as long as you declare your doctype properly.
Re:Bad Idea (Score:3, Interesting)
Same problem with english. Most people have a high degree of fault tolerance when parsing natural language, which means any old crap will still just about be readable.
(sorry - I had to after reading that statement heh)
Re:Bad Idea (Score:2)
Missing the point (Score:5, Insightful)
Shell scripts should be short and easy to write. I have seen plenty of them fail due to some resource or another being temporarily down. At first people are neat and then send an email to notify the admin. When this then results in a ton of emails everytime some dodo knocks out the DNS they turn it off and forget about it.
Every scripting language has their own special little niche. BASH for simple things, perl for heavy text manipulation, PHP for creating HTML output. This scripting language is pretty much like BASH but takes failure as given. The example shows clearly how it works. Instead of ending up with PERL like scripts to catch all the possible errors you add two lines and you got a wonderfull small script, wich is what shell scripts should be, that is none the less capable of recovering from an error. This script will simply retry when someone knocks out the DNS again.
This new language will not catch your errors. It will catch other peoples errors. Sure a really good programmer can do this himself. A really good programmer can also create his own libraries. Most find of us in admin jobs find it easier to use somebody elses code rather then constantly reinvent the wheel.
Re:Missing the point (Score:5, Insightful)
On a side note for Perl, one thing I always hated were the examples that had something like "open( FH, "file/path" ) || die "Could not open file!" . $!; I mean, come one, you don't want your script to just quit if it encounters an error...how about putting in an example of error handling other than the script throwing up its hands and quitting! LOL.
Please excuse any grammatical/other typos above, I was on 4 hrs sleep when I wrote this. Thank You.
Re:Missing the point (Score:5, Insightful)
Yet we are expected to excuse your grammatical and typos. Doesn't that just promote bad practices? Shouldn't we whack you over the head with a baseball bat just to make sure you won't post when you're not prepared to write flawless posts?
The more work you have to do to check errors, the more likely it is that however vigilant you might be, errors slip past. If you have to check the return values of a 100 commands, that is a 100 chances for forgetting to do the check or for doing the check the wrong way, or for handling the error incorrectly.
In this case, the shell offers a function that provides a more sensible default handling of errors: If you don't handle them, the shell won't continue executing by "accident" because you didn't catch an error, but will terminate. It also provides an optional feature that let you easily retry commands that are likely to fail sometimes and where the likely error handling would be to stop processing and retry without having to write the logic yourself.
Each time you have to write logic to handle exponential backoff and to retry according to specific patterns is one more chance of introducing errors.
No offense, but I would rather trust a SINGLE implementation that I can hammer the hell out of until I trust it and reuse again and again than trust you (or anyone else) to check the return code of every command and every function they call.
This shell does not remove the responsibility to for handling errors. It a) chooses a default behaviour that reduces the chance of catastrophic errors when an unhandled error occurs, and b) provides a mechanism for automatic recovery from a class of errors that occur frequently in a particular type of systems (distributed systems where network problems DO happen on a regular basis), and by that leave developers free to spend their time on more sensible things (I'd rather have my team doing testing than writing more code than they need to)
Mod up! (Score:4, Informative)
Re:Missing the point (Score:2)
Write your scripts to fail safe, then don't perform ad-hoc updates, schedule them regularly.
Re:Bad Idea (Score:5, Interesting)
The same logic could be applied to any security system, from the automatic door lock on the front of your house to Airbags in your car. Spell checkers discourage people from learning to spell. Antibiotics prevent the growth of the immune system. Why have a lock on your trigger, if it will encourage you to leave it in a place where your kids can find it.
The fact of the matter is, if the code works, it's good code. This is a shell scripting language we're talking about here... Not exactly assembly. Programmers would be better off spending more time thinking about the higher structure of their applications and less time hunting down trivial mistakes.
Of course, I know that this isn't quite what the article is talking about, but it's the principle of the thing. Augmentation would be an improvement.
Re:Bad Idea (Score:5, Insightful)
Done correctly, spellcheckers can be the best spelling-learning tool there is.
"Correctly" here means the spell-checkers that give you red underlines when you've finished typing the word and it's wrong. Right-clicking lets you see suggestions, add it to your personal dict, etc.
"Incorrectly" is when you have to run the spell-checker manually at the "end" of typing. That's when people lean on it.
The reason, of course, is feedback; feedback is absolutely vital to learning and spell-checkers that highlight are the only thing I know of that cuts the feedback loop down to zero seconds. Compared to this, spelling tests in school where the teacher hands back the test three days from now are a complete waste of time. (This is one of many places where out of the box thinking with computers would greatly improve the education process but nobody has the guts to say, "We need to stop 'testing' spelling and start using proper spell-checkers, and come up with some way to encourage kids to use words they don't necessarily know how to spell instead of punishing them." The primary use of computers in education is to cut the feedback loop down to no time at all. But I digress...)
'gaim' is pretty close but it really ticks me off how it always spellchecks a word immediately, so if you're typing along and you're going to send the word "unfortunately", but you've only typed as far as "unfortun", it highlights it as a misspelled word. Bad program! Wait until I've left the word!
Spell checkers and homonyms (Score:2)
To, too
Re:Spell checkers and homonyms (Score:3, Insightful)
Of course not. But using a spell checker means having time to learn about the homonyms, instead of endlessly playing catch up.
You still predicated your post on "relying" on spell checkers; I'm saying that people learn from good spell checkers. That people can't learn everything from a spell checker is hardly a reason to throw the baby out with the bath water and insist that people use inferior learning techniques anyhow!
A kid that
Re:Bad Idea (Score:3, Insightful)
You've got it backwards.
Most shell scripting is quick and dirty; no one checks error codes (mostly because it's a nuisance). FTSH makes it easier to check error codes, in part because the default behavior is the bail on
Oooh! An idea whose time has come! (Score:2, Funny)
Wouldn't be much work in Tcl (Score:5, Interesting)
It doesn't actually seem to grok the commands that are being run, so something like
proc try {times script} {
if { [catch [uplevel $script] err] } { cleanup ; retry }
}
is all that's needed (of course to do it right you'd need a bit more, but still...).
try {5 times} {
commands...
}
Although Tcl is a bit lower level, and would require you to do exec ls, you could of course wrap that too so that all commands in the $script block would just be 'exec'ed by default.
In any case, better to use a flexible tool that can be tweaked to do what you need then write highly specialized tools.
Re:Wouldn't be much work in Tcl (Score:3, Insightful)
def college_try (limit, seq =0)
begin
yield
catch e
# forgot the syntax for getting the block
college_try( limit, seq + 1, block ) if (seq < limit)
end
end
college_try( 50 ) {
begin
do some work
catch e
do error clean up here
raise e
ensure
do cleanup that should always run here
end
}
Anyways, I agree with the notion that most popular scripting languages have advanced error handling that is up to the task
Re:Wouldn't be much work in Tcl (Score:3, Interesting)
Your example only does a fraction of what ftsh does.
Re:Wouldn't be much work in Tcl (Score:3, Insightful)
> of what ftsh does.
yawn, so we didn't post a 100-500 line library in our slashdot comment.
the point is, this stuff would be trivial to implement in language like ruby. plus, using a full scripting language you get lots of other useful features like regular expressions, classes, etc, etc
It's a good idea, but it's a library implemented as a language.
Re:Wouldn't be much work in Tcl (Score:2)
Worst idea since spell checkers (Score:4, Insightful)
This si even worse. Computers will try to second guess what the user means, get get it wrong half tyhe time.
A qualified shell scripter will be not make these mistakes in the first place. Anyone who thinks they need this shell actually just need to learn to spell and to ytype accuratly.
Re:Worst idea since spell checkers (Score:3, Funny)
Re:Worst idea since spell checkers (Score:5, Funny)
<Teal'c> Indeed </Teal'c>
RTFA (Score:2, Insightful)
"It [ftsh] is especially useful in building distributed systems, where failures are common, making timeouts, retry, and alternation necessary techniques."
It doesn't protect you from typos in the script, it handles failures in the commands that are executed.
Re:Worst idea since spell checkers (Score:2)
Re:Worst idea since spell checkers (Score:2, Interesting)
Also, this isn't about covering up mistakes. I am sure good script programmer will _allways_ assume a command can fail. Using the example of the "cd" command in the article, should I really just assume it worked before removing files? Of course not. How ftsh helps is that the necessary error checking code is made more readable and brief. I still have to trap
Re:Worst idea since spell checkers (Score:2)
Argh. You are the second or third to bring up this silly spell checker analogy.
The software is not called the "mistake-tolerant" shell. It is the fault tolerant shell. It handles faults like hard drive crashes, network outages, cosmic rays, and yes, probably software bugs as a side effect. Look at the feature set: they are much more geared towards hardware failure than software failure. How does retry or exponential backoff help if a software bug prevents a computation from correctly completing? Actually,
It's got the concept backwards (Score:5, Insightful)
Instead, you automate everything and *pull* updates, changes, scripts etc. That way if a system is up, it just works, if it's down, it'll get updated next time it's up.
I won't go into details but I'll point you at http://infrastructures.org/
Re:It's got the concept backwards (Score:3, Interesting)
The thing is, if you run a distributed system with a thousand servers, and your patch distribution points drop of the network, you don't suddenly want a thousand servers hammering the networks endlessly. You want things like exponential backoff, timeouts after which the system will change behaviour (stop requesting updates until explicitly re
Re:It's got the concept backwards (Score:4, Interesting)
Check once every 1,2,4,8,16,32,64,whatever,mins *all the time anyway* whether it fails or succeeds and you *absolutely don't* want to have to explicitly tell 1000 machines to start again.
You simply generalise the update process, get rid of the special cases. In the case of patches, you know you're going to have to distribute them out to clients at some point anyway so have all the clients check once a day, every day. If the distribution server is down for a couple of days it's pretty much irrelevant.
My error detection code is trivial the network traffic is negligible unless the job's actually being done and I still haven't been given a good case for ftsh. I have a good case for a better randomising algorithm within a shell and a decent distributed cron (which is simple BTW), but not for a specifically fault tolerant shell.
You've got to stop thinking of these things as individual systems. The network is the machine.
Sounds like good way to do some serious damage (Score:3, Interesting)
Re:Sounds like good way to do some serious damage (Score:3, Insightful)
This would be nice... (Score:5, Insightful)
This would REALLY be useful when you're connecting to services external to yourself - network glitches cause more problems with my code than ANYTHING else, and it's a pain in the arse to write code to deal with it gracefully. i'd really really like to see a universal "try this for 5 minutes" wrapper, which, if it still failed, you'd only have one exit condition to worry about. hey, what the hell, maybe i'll spend a few days and write one myself.
One of the few who get it apparently. (Score:5, Informative)
I have often had to write such wrappers myself. Sure even easier/better would have been if somebody added this to say BASH as an extension but perhaps that is not possible.
How often have you needed to write horrible bash code just to pull data from an unreliable source and ended up either with a script that worked totally blind "command && command && command &&" wich never reported if it failed for days on end or ended up with several pages just to catch all the damn network errors that could occur.
I will definitly be giving this little language a try in the near future. Just another tool for the smart sys-admin. (smart people write as little code as possible. Let others work for you)
Re:One of the few who get it apparently. (Score:2)
rm datafile
With no -f? This is a failure condition if the condition is false, thus it would throw the code into an infinite failure loop until the timeout.
Like you're saying though, if it's a programming error, it won't get fixed, and in someways, even worse, it adds new dimensions to think about.
Let's draw a line in the sand... (Score:5, Insightful)
All the programmers who need the environment to compensate for their inadequacies, step on one side. All the programmers who want to learn from their mistakes and become better at their craft, get on the other side.
Most of us know where this line is located.
Re:Let's draw a line in the sand... (Score:4, Funny)
java, c++, c#
-------------
asm, c ?
Re:Let's draw a line in the sand... (Score:3, Interesting)
Re:Let's draw a line in the sand... (Score:2)
?
-----------
India
(Stupid Slashdot filter rules)
Re:Let's draw a line in the sand... (Score:5, Funny)
Most of us know where this line is located.
"In other news, at the local beach today a vicious fight broke out between geeks about where to draw a line. Sand was kicked, noses have been blooded, we have some unconfirmed reports of a wedgie. We will have more on this breaking news as it comes in."
Re:Let's draw a line in the sand... (Score:2, Funny)
Everybody knows all the real geeks are still in the desert trying to get their robots to go a few more miles [grandchallenge.org].
Re:Let's draw a line in the sand... (Score:5, Funny)
Redmond city limits?
Re:Let's draw a line in the sand... (Score:3, Insightful)
Re:Let's draw a line in the sand... (Score:2)
Or perhaps you didn't RTFA.
Nice, which brings me too.... (Score:5, Interesting)
Re:Nice, which brings me too.... (Score:2, Informative)
Oh, exception handling w.r.t. perl/python. (Score:2)
Building on their first example (Score:5, Insightful)
So what happens if the files are crucial (let's use the toy example of kernel modules being updated): The modules get deleted, then the update fails because the remote host is down. Presumably the shell can't rollback the changes a la DBMS, as that would involve either hooks into the FS or every file util ever written.
Now I think it's a nice idea, but it could easily lead to such sloppy coding; if your shell automatically tries, backs off and cleans up, why would people bother doing it the 'correct' way and downloading the new files before removing the old ones?
Re:Building on their first example (Score:2)
It's not about cleaning up. It's about fault tolerance. Deleting the data file in the case of the example is NOT a failure. Presumably the file
How long until... (Score:3, Funny)
Re:How long until... (Score:2)
Signed the girl.
login (Score:5, Funny)
Re:login (Score:4, Funny)
Using wget as an example (Score:2)
Re:Using wget as an example (Score:2)
With the right options wget is appropriate for almost anything. You'd be surprised to see the list of possible options you can specify for wget. You can specify timeout as well as number of retries, which means it would also be usable for the scenario you describe. Though it seems like wget doesn't have exponential backoff, only linear backoff, and there seems to be no options to change the backoff strategy. Which one of exponential and linear is best of course depe
this can essentially already be done in /bin/bash (Score:5, Interesting)
what they seem to essentially want is
it can even be done without extending the shell:
as for the new syntax of .eq. .ne. .lt. .gt. .to.
certainly looks like fortran-hugging to me , yuck
as for integer arithmetic, that can be done with by either using backticks or the $[ ] expansion
Golden hammer (Score:2, Insightful)
The author merely thinks it would be nice to have a shell in which such fault-tolerant constructions are natural by design. Just to save people headaches when writing simple scripts which are there to get some job done, not to waste time dea
Re:this can essentially already be done in /bin/ba (Score:2)
ftsh provides a mechanism aimed at making it easier to catch and handle error conditions correctly. How does that encourage sloppy coding?
As for your bash example, it only demonstrates the most basic capability of ftsh - exiting on error. I
Re:this can essentially already be done in /bin/ba (Score:2)
If your comment on fault-tolerant coding adressed shells that correct misspellings, that doesn't make it any more insightful. There is no reason to assume such a shell would encourage sloppy coding - the many examples in this article demonstrates very well why no such shell has been written: It could create dangerous situations from otherwise harmless mistakes - there is no indication t
Once again, Babbage was thinking ahead... (Score:5, Interesting)
Babbage, if you put into the machine wrong figures, will the right answers
come out?' I am not able rightly to apprehend the kind of confusion of ideas
that could provoke such a question."
-- Charles Babbage
Why is there a Windows compatible port? (Score:2, Insightful)
Re:Why is there a Windows compatible port? (Score:2, Insightful)
Uh.. it's just you. You should, y'know, maybe try using Windows 2000 or XP sometime... Windows has a perfectly good command line. Point at the "Start" menu, click "Run" -> type "cmd", and away you go.
You can turn on command line completion (search for "TweakUI" or "Windows Powertoys", I can't be bothered to link to them). And even pipes work just fine (as they have since the DOS days). For example:
Re:Why is there a Windows compatible port? (Score:2)
It's on by default in Windows XP Service Pack 1.
Re:Why is there a Windows compatible port? (Score:2, Interesting)
some people, (I myself too) use bash as a daily basic for Windows, this new stuff can be interesting and maybe usefull for the unsafe windows enviroment.
Re:Why is there a Windows compatible port? (Score:2)
I don't see why eveyone is complaining... (Score:4, Interesting)
Well.. besides pipes of course
Why there are no pipes (Score:4, Interesting)
Funny you should mention this, because I was going to write something about pipes. Getting pipes right with good error semantics is hard. For all the "just use set +e in bash" weenies out there, try running
Where's your error?If you think about the unix process and pipe primitives, you will see the difficulty. To create a pipeline, you normally fork, create the pipe, fork again, and run the two ends of the pipeline in the two sub-processes. This is scalable to deeply nested pipelines, but has a cost: Only one of the sub-processes is a child of the shell, so only one exit status can be monitored. To work around this, you really need to build a mini-OS environment on top of unix.
This demonstrates that unix was fundamentally not designed with concern for error semantics (consider Erlang as a diametric example). And this, I'm sure, is why ftsh doesn't have pipes (yet).
Re:Why there are no pipes (Score:2)
Insert Emacs joke here.
In Monopolistic America (Score:3, Funny)
Not good (Score:4, Funny)
Probable typing error detected. Parsed as rm -Rf /
Another Clippy Moment (Score:2)
I see you're trying to vaporize your UNIX system. Would you like to:
A distributed shell ... (Score:2, Interesting)
I think the shell was called dsh. I believe this is the project site: http://dsh.sourceforge.net/
Are the aims of this fault tolerant shell and dsh the same? I'm not a programmer, but I'm trying to teach myself *nix system administration.
Eventually I'm hoping to cluster some older x86 systems I'm going to get at auction together for a Beowulf cluster. It sounds to me like one i
OK, wise guys... (Score:5, Interesting)
ftsh has great utility in the realm it's written for. Obviously, it's not a basis for installing kernels or doing password authentication. In a Grid (not just distributed) environment, things break for all sorts of reasons all the time. You're dealing with a Friendly Admin on another system, one who may well be unaffiliated with your institution, project or field of study. He doesn't have any particular reason to consult with you about system changes.
Now you find yourself writing a grid diagnostic or submitter or job manager. One does not need strongly typed compiled languages for this. Shell scripts are almost always more efficient to write, and the speed difference is unimportant. Right now, most Grid submitters are being written in bash or Python or some such. Bash sucks for exception handling of the sort we're talking about. Python does better with its try: statements, but there's room for improvement. ftsh is a good choice for a sublayer to these scripts. One writes some of the machinery that actually interacts with the Grid nodes and supervisors in this easy, clear and flexible form.
Now there are a lot of specific points to answer:
One needs a Windows port to be able to make the Grid software we write in Linux available to the poor drones who are stuck with Win boxes.
This is not a code spellchecker or coding environment. At all.
This is not a crutch for inadequate programmers. This is a collection of methods to deal with a specific set of recalcitrant problems.
As I was pointing out before, this is, after all, an unstable system. One is using diverse resources on diverse platforms in many countries at many institutions. I appreciate the comment made by unixbob about operating in heterogeneous environments.
This isn't a substitute for wget. One uses wget as an example because it's clear.
The "pull" model breaks down immediately when there is no unified environment, as is described on infrastructures.org. When you're not the admin, and your software has to be wiped out the minute your job is done, "push" is the only way to do it. This is the case with most Grid computing right now (that I know about)
:) Use the right tool for the job and save time.
:)
All the woe and doom about the sloppy coding and letting the environment correct your deficiencies is... ill-thought-out. That's what a compiler is, folks. Should we all be coding in machine language?
I do agree, however, that one should indeed hone one's craft. Sloppy coding in projects of importance is inexcusable (M$). There is no reason to stick to strict exception handling, however, in the applications being discussed by ftsh's developers (the same folks who brought you Condor). When code becomes 3/4 exception handling, even when the specific exceptions don't matter, there's a problem, IMHO.
Sorry, there just isn't a case for it. (Score:2)
In Grid based computing environments, jobs queue until they can be started, and as it happens, they tend to be architected as pull based systems whether you see that as a user or not.
Again, I can't see a reason for ftsh in this case. I'm sure there's a niche for it
rm -rf $(TEMPFILE) /dev/null (Score:2)
Argh.
Wish the shell would have added the (obvious) ' > '
"set -e" will go a long way to helping you (Score:5, Interesting)
That shell script can be improved a lot by using " set -e " to exit on failure, as follows:
#!/bin/sh
set -e # exit on failure
cd
rm -rf bar
cp -r
This means that, if any command in the script fails, the script will exit immediately, instead of carrying on blindly.
The script's exit status will be non-zero, indicating failure. If it was called by another script, and that had "set -e", then that too will exit immediately. This is a little bit like exceptions in some other languages.
Comment removed (Score:3, Insightful)
Code not very tolerant of my machine! (Score:2, Informative)
Then it compiled (on Fedora Core 1).
Then it failed the functions test, because my computer does not have the file /etc/networks. For a fault tolerant shell, it does not seem very tolerant of my machine! Aft
If you want a fault tolerant scripting language (Score:4, Informative)
You can have multiple linked interpreters and
even fault-tolerant database!
It is a scripting language.
From the FAQ:
1.1. In a nutshell, what is Erlang?
Erlang is a general-purpose programming language and runtime environment. Erlang has built-in support for concurrency, distribution and fault tolerance. Erlang is used in several large telecommunication systems from Ericsson. The most popular implementation of Erlang is available as open source from the open source erlang site.
ACID Filesystems (Score:3, Interesting)
Remounting a filesystem with ACID on, a process sets a rollback point , executing a series of commands with the operating system keeping a record of the changes to the filesystem made by the process and its children. The process would inform the OS to either commit or rollback the changes.
This still raises questions on how to deal with with two or more competing "transactional" processes which rely on read information which another process chooses to rollback to an early state.
What's with all the negativity? (Score:5, Interesting)
I think perl is where it is because so many people use it as "super script." To me that says, a) we recode all the Bourne and csh and bash in perl or b) we look at why people do shell scripting in perl or other languages and add that to the shell. I couldn't tell you which is right. It's a neat idea though and I'm glad they made it.
A real example I can think of, I had a test machine that had some kind of ext3 corruption and so it mounted up in read-only mode when it booted. I spent time diagnosing an application error in our application because nothing caught that; these are redhat type startup scripts. I noticed that our app couldn't write logs and began to debug the system. More interestingly, a dozen or so start-up scripts failed to start up critical components and their failure wasn't noticed. If you can't write to the filesystem, you can't create a socket(AF_UNIX) and all sort's of things go tits up then. If that's how you debug it's only going to get more difficult as you add more and more complexity, you have to detect the lower level failures and report them. Perversely, this wouldn't have been noticed had a different partition been read-only. Turns out that a drive was going bad. Had it been a different partition, it would have been noticed at catastrophic system failure time when the drive died.
I've done a fair amount of embedded work and there is always a test for new guys, you can tell the new guy (new college grad, whatever) because he skips half or more of the error checking in his code. You know printf returns a value? Funnier still, if you develop something like a consumer app in embedded space, you'll eventually see things like printf fail. We know it never should, but with 20,000+ users in different environments and what not, things like that can and do fail and usually point to a greater problem, like a dead drive or something. Instead of logging/alerting something to the critical and unusual printf failure, the app fails in a different way because this printf failed. Heaven forbid that it was sprintf that failed and then you shove bad data in to a database or configuration file and not just fail the system but corrupt the data too. Inspite of all of that, even veterans will forget error checking at times, it's a common bug and so having higher level tools to help assist, like exception in the shell can only be a good thing.
i get it, but i don't... (Score:2)
cd
rm -rf bar
cp -r
would this not suffice:
cd
my undertanding of && was that it only executes in the previous command didn't throw some sort of error. i understand its not as powerful as what he's talking about, but there is some degree of fault tolerance there.
secondly, i don't know about you, but i would be very uncomfortable with something that tries a few thousand times or for a particular amount
FTSH is an exception system for shell programming (Score:5, Insightful)
What's with all of the people claiming that FTSH will ruin the world because it makes it easier to be a sloppy programmer. Did you freaking read the documentation?
To massively oversimplify, FTSH adds exceptions to shell scripting. Is that really so horrible? Is of line-after-line of "if [$? -eq 0] then" really an improvement? Welcome to the 1980's, we've discovered that programming languages should try and minimize the amount of time you spent typing the same thing over and over again. Human beings are bad at repetitive behavior, avoid repetition if you can.
Similarlly FTSH provides looping constructs to simplify the common case of "Try until it works, or until some timer or counter runs out." Less programmer time wasted coding Yet Another Loop, less opportunities for a stupid slip-up while coding that loop.
If you're so bothered by the possibility of people ignoring return codes it should please you to know that FTSH forces you to appreciate that return codes are very uncertain things. Did diff return 1 because the files are different, or because the linker failed to find a required library? Ultimately all you can say is that diff failed.
Christ, did C++ and Java get this sort of reaming early on? "How horrible, exceptions mean that you don't have to check return codes at every single level."
Re:Been tried (Score:2)
Re:First Real Post (Score:3, Informative)