git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: git@vger.kernel.org
Cc: David Barr <david.barr@cordelta.com>,
	Ramkumar Ramachandra <artagnon@gmail.com>,
	Sverre Rabbelier <srabbelier@gmail.com>
Subject: [RFC/PATCH 0/4] improving svn-fe error handling
Date: Tue, 28 Dec 2010 04:45:03 -0600	[thread overview]
Message-ID: <20101228104503.GA5422@burratino> (raw)

Hi,

Currently malformed streams (e.g., ending early) and input errors when
reading a dump file can cause svn-fe to dereference a NULL pointer or
otherwise act in a confusing way.  Especially since incremental
imports work now, I think a saner behavior is to error out with a
clear error message; the operator can then fix the problem and resume.
This series is an attempt in that direction.

Still to do:
 - add tests (reading /dev/full?  how else to provoke an input error?)
 - change buffer_read_string to disallow short reads, to simplify

I am sending it out now because patches 1, 2, and 3 make API changes
that I find convenient, so I'd be interested in your thoughts before
I commit too heavily to a bad idea.

Patch 1 introduces buffer_ferror, to check if errors were encountered
reading from the line_buffer.  Unlike buffer_deinit, this can be used
after any operation so it can be used early, when errno is still valid.

Patches 2 and 3 make operations that can be partially completed
still return some indication of success or failure.

Patch 4 is an example application, using the new API to make svn-fe
a little better at detecting malformed dump files.

Thoughts?
Jonathan Nieder (4):
  vcs-svn: allow input errors to be detected promptly
  vcs-svn: make buffer_skip_bytes return length read
  vcs-svn: make buffer_copy_bytes return length read
  vcs-svn: improve reporting of input errors

 vcs-svn/fast_export.c   |   13 +++++++++-
 vcs-svn/line_buffer.c   |   36 ++++++++++++++++++-------------
 vcs-svn/line_buffer.h   |    6 +++-
 vcs-svn/line_buffer.txt |    3 +-
 vcs-svn/svndump.c       |   53 +++++++++++++++++++++++++++++++++++++---------
 5 files changed, 80 insertions(+), 31 deletions(-)

             reply	other threads:[~2010-12-28 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-28 10:45 Jonathan Nieder [this message]
2010-12-28 10:47 ` [PATCH 1/4] vcs-svn: allow input errors to be detected promptly Jonathan Nieder
2010-12-28 10:48 ` [PATCH 2/4] vcs-svn: make buffer_skip_bytes return length read Jonathan Nieder
2010-12-28 10:49 ` [PATCH 3/4] vcs-svn: make buffer_copy_bytes " Jonathan Nieder
2010-12-28 10:54 ` [PATCH 4/4] vcs-svn: improve reporting of input errors Jonathan Nieder
2011-01-04 10:16   ` Jonathan Nieder

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=20101228104503.GA5422@burratino \
    --to=jrnieder@gmail.com \
    --cc=artagnon@gmail.com \
    --cc=david.barr@cordelta.com \
    --cc=git@vger.kernel.org \
    --cc=srabbelier@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).