From: Pete Zaitcev <zaitcev@redhat.com>
To: Colin McCabe <cmccabe@alumni.cmu.edu>
Cc: Jeff Garzik <jeff@garzik.org>,
Project Hail List <hail-devel@vger.kernel.org>
Subject: Re: the evils of the CLD api
Date: Sat, 16 Jan 2010 16:21:35 -0700 [thread overview]
Message-ID: <20100116162135.03b6de7b@redhat.com> (raw)
In-Reply-To: <436f52801001161338w7c6ec624s3c07b7e950904b9d@mail.gmail.com>
On Sat, 16 Jan 2010 13:38:26 -0800
Colin McCabe <cmccabe@alumni.cmu.edu> wrote:
> Shouldn't ncld_unlock and ncld_close return an error code rather than
> just eating all errors? The server certainly does sometimes send back
> error responses for these requests.
This is an old bone of contention. The problem is, suppose the
application is cleaning up for exit. What is it supposed to do with
the error code? It cannot even retry sanely.
> The event() callback seems like to lead to some complexity. For
> example, let's say I have a "main" thread that does ncld_open, and
> then ncld_write. []
Indeed, it reopens the old problems somewhat. The plan is to see
how ncld matches tabled and chunkd and perhaps tweak the API a bit.
> I guess the main thread could check an atomic variable before each
> ncldc operation (has_failed? is_gone?) Or a mutex-protected variable.
That's pretty much what I expect from most command-line tools.
The check is implicit in read/write/lock operations.
> Rather than the event callback, I almost feel like it would be better
> just to have an ncldc_poll function modelled on poll(). []
If we do that, we're at the square 1 with respect to complexity
reduction in a multi-thread environments. If someone wants that,
they may continue to use cldc_foo.
As a reminder, my aim here is 2-fold:
1. Provide something that permits to use synchronous programming in
cldu.c. I am having a big trouble modifying it, and I know that
when we support slave mode, I'll need even more complex behaviour
from it. It will crash on itself unless I implement ncld.
2. Make something that lures new contributors into a sense of simplicity.
We keep saying that it's almost like a filesystem, only not quite
POSIX. But the actual API is such that nobody will use it if he
has an alternative. We need a pseudo-filesystem API to continue
making these claims with a straight face.
Anything else is not a goal, at least thus far. And actually I am
going to resist expanding ncld's scope too much and ruining the
simplicity of the model. You want async, use cldc.
-- Pete
next prev parent reply other threads:[~2010-01-16 23:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-16 2:40 the evils of the CLD api Colin McCabe
2010-01-16 6:53 ` Pete Zaitcev
2010-01-16 21:38 ` Colin McCabe
2010-01-16 23:21 ` Pete Zaitcev [this message]
2010-01-17 1:54 ` Colin McCabe
2010-01-17 5:55 ` Pete Zaitcev
2010-01-19 21:54 ` Pete Zaitcev
2010-01-18 21:58 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100116162135.03b6de7b@redhat.com \
--to=zaitcev@redhat.com \
--cc=cmccabe@alumni.cmu.edu \
--cc=hail-devel@vger.kernel.org \
--cc=jeff@garzik.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.