[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Multiple Concurrent Connections?

From: Blair Zajac <blair_at_orcaware.com>
Date: 2007-07-20 01:40:29 CEST

Tim Coulter wrote:
> On Wed, 2007-07-18 at 23:03 -0700, Blair Zajac wrote:
>> Tim Coulter wrote:
>>> All,
>>> Is Subversion supposed to handle multiple concurrent connections using
>>> the Ruby bindings through the FS module, or am I supposed to limit it to
>>> one connection at a time (say, using threads and synchronizing)?
>>> I'm connecting to Subversion straight from the filesystem API, and I'm
>>> not going through a client context. I seem to get random errors which
>>> suggest that the ladder is true.
>>> Thanks for your help,
>>> Tim Coulter
>> Did you see this in svn_fs.h?
> No I didn't, but that explains things a bit. I am using Svn::Repos.open
> (the Ruby binding equivalent to svn_repos_open()) to access the
> repository, but I can't seem to perform filesystem functions (like
> writing data during a commit) using simply Svn::Repos itself. As far as
> I know, I have to delve into the Svn::Fs::Root.apply_text function
> during a transaction in order to make any changes -- this is where the
> segmentation faults (some of my random errors) seem to occur.

Yes, the svn_repos.h uses svn_fs.h.

> Is your Subversion server open source, so that I may look at the code
> and try to compare the two implementations? At the heart of it, I'm
> creating something similar to a Subversion server, but instead of having
> users committing code, the software is "committing" data using
> Subversion as its backend. (Subversion is totally taking the place of
> the database, in this case, MySQL. I'm not sure if this is an
> "intelligent" decision yet, but is sure is cool. :) )

No, the code is not open source. I'm doing the same thing, but in Python using
Ice (www.zeroc.com) as the RPC layer, which allows for easy porting to C++ when
we need to optimize the server, if we ever do, since Python has a global
interpreter lock.

We've yet to see if this idea will turn out well :)

>> * Only one thread may operate on any given filesystem object at once.
>> * Two threads may access the same filesystem simultaneously only if
>> * they open separate filesystem objects.
>> *
>> * @note You probably don't want to use this directly. Take a look at
>> * svn_repos_open() instead.
>> *
>> * @since New in 1.1.
>> */
>> svn_error_t *svn_fs_open(svn_fs_t **fs_p, const char *path,
>> apr_hash_t *fs_config, apr_pool_t *pool);
>> In my multithreaded Python Ice Subversion server, I have a pool of
>> svn_fs_t's that are checked out and checked back in per RPC request. If
>> the pool is empty, I just create a new svn_fs_t.
> Can you tell me what a svn_fs_t stands for? A quick google didn't turn
> anything up.

fs = filesystem, it's an opaque type.

> Also, is there a book I really should be reading? I've gotten pretty far
> on my own, but it seems now I'm getting deeper into Subversion than I
> had expected (this isn't a bad thing).

As Ben suggested, reading the chapter of the book to use the API and then read
the header files in subversion/include.


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 20 01:39:42 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.