Skip to content

improving svn-fe error handling

Jonathan Nieder git 1 version In review

Get series with b4
b4 am 20101228104503.GA5422@burratino

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4vcs-svn: allow input errors to be detected promptlyvcs-svn/line_buffer.c vcs-svn/line_buffer.h+6 -00 replies
2/4vcs-svn: make buffer_skip_bytes return length readvcs-svn/line_buffer.c vcs-svn/line_buffer.h vcs-svn/line_buffer.txt+10 -80 replies
3/4vcs-svn: make buffer_copy_bytes return length readvcs-svn/line_buffer.c vcs-svn/line_buffer.h+11 -100 replies
4/4vcs-svn: improve reporting of input errorsvcs-svn/fast_export.c vcs-svn/svndump.c+53 -131 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC/PATCH 0/4] improving svn-fe error handling

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(-)