Bug 151971 - kdesvn-build aborts with: "IPC failure during Subversion update: Invalid argument"
Summary: kdesvn-build aborts with: "IPC failure during Subversion update: Invalid argu...
Status: RESOLVED FIXED
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: general (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-07 10:08 UTC by Michael Olbrich
Modified: 2007-11-13 01:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
New async handling algorithm (18.86 KB, patch)
2007-11-13 00:29 UTC, Michael Pyne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Olbrich 2007-11-07 10:08:04 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Since the last change (parallel svn up and build) kdesvn-build fails
every time with the following output:
-------------------------------------------------------------------
Building kdepim (14/26)
        Waiting for source code update.
 *** kdepim: IPC failure during Subversion update: Invalid argument

<<<  PACKAGES FAILED TO BUILD  >>>
...
-------------------------------------------------------------------
The only logfile for kdepim is svn-up.log. It looks fine (ends with
"Updated to revision ..."
Comment 1 Michael Pyne 2007-11-08 23:03:11 UTC
I've also experienced this bug, as have Andreas Pakulat.  Oddly enough, it was kdepim for myself and for Andreas as well.  I suspect this is related.  Hopefully just a stupid debugging statement I left in...
Comment 2 Michael Pyne 2007-11-11 02:38:20 UTC
I believe the shared message queue is being freed somehow but I can't find out what's doing it.

I think since I can't reproduce the bug I'm simply going to convert it to use something else.  Probably anonymous pipes at this point.  Stay tuned.
Comment 3 Michael Pyne 2007-11-13 00:29:12 UTC
Created attachment 22042 [details]
New async handling algorithm

This is a patch that uses a different algorithm to handle the asynchronous
update and build.  The final committed version will be at least a little
different (I'm going to change all those sendToMonitor() receiveFromMonitor()
calls back since that breaks NullIPC) but this version does work (except for
NullIPC :).

At least it should work.  It works for me, please let me know if it works for
you.

The way it works if you're so inclined: I use anonymous pipes in order to
handle the communications between the update and build processes.  pipes are
simpler so you may wonder why I didn't use them in the first place.

Well, that was to avoid the situation where the svn update process would be
caught waiting on the build process just to notify about successful or failed
updates.  In addition the pipe would go away as soon as the update process did,
causing lost information for the build process.

The solution is to introduce yet another process, a monitoring process which
will outlive the update process.  The monitoring process waits for both the
build and update processes (using select(2)).  Whenever the update process has
something to report the monitor saves it for when the build process is ready. 
It doesn't exit until it has given all the messages to the build process.

The build process is still the main (i.e. longest-lived) process.

This Works For Me(TM), but I would be interested to know if it works on other
UNIX variants.
Comment 4 Michael Pyne 2007-11-13 01:29:44 UTC
SVN commit 735914 by mpyne:

Fix bug 151971 (kdesvn-build SVN aborts with IPC failure).

I was never able to pin down what was causing the bug, or to reliably reproduce
it.  So I went and completely ditched the old IPC code instead. :(

It has been rewritten using anonymous pipes and adding an extra process so that the
update and build processes can both proceed unfettered.

Also added is a command line option (--no-async) to disable the IPC stuff.  You can
set it as a config file option as well (just called async), it defaults to enabled.

In addition the async mode is turned off unless performing both the update and build
processes.  In theory async mode should always work but I see no reason to test the
issue unnecessarily.

BUG:151971


 M  +393 -124  kdesvn-build  


WebSVN link: http://websvn.kde.org/?view=rev&revision=735914