You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Sam Lee <sk...@gmail.com> on 2013/02/07 19:23:37 UTC

single threaded mode?

Hey,

I am getting lots of:
Caused by: org.apache.jackrabbit.core.state.StaleItemStateException:
30a33d9e-ed9a-42bf-a8c6-14c74b6b3858/{
http://www.day.com/jcr/cq/1.0}lastReplicatedBy has been modified externally

on different JCR items.

How can I run sling in single threaded mode? Only one thread will write to
the repository. Or, one servlet thread handles all concurrent HTTP requests
(after queuing them up).
Is this possible?

Re: single threaded mode?

Posted by Jörg Hoh <jh...@googlemail.com>.
Sam,

do you really need all clients post to the same node(s)? If you post to a
folder, the PostServlet will create appropriate subnodes for you, one for
each POST. You an also specify a pattern for the nodenames.

curl -s -u admin:admin -Fprop=value localhost:4502/content/

(A nice cheatsheet for the Post servlet:
http://www.unc.edu/home/adamc/post-servlet.html)

Jörg



2013/2/19 Sam Lee <sk...@gmail.com>

> Using sling6 stand alone jar file, if I create 50 nodes and 50 properties
> on each node using 4 concurrent POSTs:
> $ seq 50 | xargs -P2 -I% bash -c "seq 50 | xargs -P2 -I~  curl -s -u
> admin:admin -Fprop~=value~ localhost:5100/tmp/test/node%"  > /dev/null
> (more than one POST to same node)
>
> I get garbage nodes like /tmp/test/node1[2] .
> And, node1  doesn't get all 50 properties.
>
> That seems to be due to concurrent POST to the same node.
> For example, executing these in parallel creates node1[2]  even though I am
> POSTing to node1
> curl -u admin:admin -Fprop1=value1 localhost:5100/tmp/test/node1
> curl -u admin:admin -Fprop2=value2 localhost:5100/tmp/test/node1
>
>
> When I use 4 concurrent POSTs but force them to POST to different nodes, I
> don't get such weird behavior:
> $ seq 50 | xargs -P4 -I% bash -c "seq 50 | xargs -P1 -I~  curl -s -u
> admin:admin -Fprop~=value~ localhost:5100/tmp/test/node%"  > /dev/null
>
>
> I don't really have control of clients (web <form>'s). More than one user
> might submit the same form that will POST to same node.
> Is there a way to control concurrent number of POSTs to the same node in
> sling? I can't find plausible configuration on under
> /system/console/configMgr/
>
> Or, can this be fixed through jackrabbit configuration?
>
> Or should I use a proxy server that can allow only 1 concurrent POST per
> url?
>
> Has anyone encountered problems with concurrent POSTs to the same node? How
> did you resolve?
>
>
> On Thu, Feb 7, 2013 at 5:21 PM, Paul McMahon <or...@yahoo.com> wrote:
>
> > I don't think that you'd really want Sling running in single threaded
> mode
> > - your performance would rapidly become unusable.
> >
> > Given that error I assume this is a CQ instance. You might want to check
> > with daycare - depending on which version of CQ you are one there might
> be
> > hot fix that resolves that issue - I seem to recall one at least
> > (specifically the on around replication data).
> >
> > Paul McMahon
> >
> >
> > ________________________________
> >  From: Sam Lee <sk...@gmail.com>
> > To: users@sling.apache.org
> > Sent: Thursday, February 7, 2013 10:23 AM
> > Subject: single threaded mode?
> >
> > Hey,
> >
> > I am getting lots of:
> > Caused by: org.apache.jackrabbit.core.state.StaleItemStateException:
> > 30a33d9e-ed9a-42bf-a8c6-14c74b6b3858/{
> > http://www.day.com/jcr/cq/1.0}lastReplicatedBy has been modified
> > externally
> >
> > on different JCR items.
> >
> > How can I run sling in single threaded mode? Only one thread will write
> to
> > the repository. Or, one servlet thread handles all concurrent HTTP
> requests
> > (after queuing them up).
> > Is this possible?
> >
>



-- 
Cheers,
Jörg Hoh,

http://cqdump.wordpress.com

Re: single threaded mode?

Posted by Sam Lee <sk...@gmail.com>.
Using sling6 stand alone jar file, if I create 50 nodes and 50 properties
on each node using 4 concurrent POSTs:
$ seq 50 | xargs -P2 -I% bash -c "seq 50 | xargs -P2 -I~  curl -s -u
admin:admin -Fprop~=value~ localhost:5100/tmp/test/node%"  > /dev/null
(more than one POST to same node)

I get garbage nodes like /tmp/test/node1[2] .
And, node1  doesn't get all 50 properties.

That seems to be due to concurrent POST to the same node.
For example, executing these in parallel creates node1[2]  even though I am
POSTing to node1
curl -u admin:admin -Fprop1=value1 localhost:5100/tmp/test/node1
curl -u admin:admin -Fprop2=value2 localhost:5100/tmp/test/node1


When I use 4 concurrent POSTs but force them to POST to different nodes, I
don't get such weird behavior:
$ seq 50 | xargs -P4 -I% bash -c "seq 50 | xargs -P1 -I~  curl -s -u
admin:admin -Fprop~=value~ localhost:5100/tmp/test/node%"  > /dev/null


I don't really have control of clients (web <form>'s). More than one user
might submit the same form that will POST to same node.
Is there a way to control concurrent number of POSTs to the same node in
sling? I can't find plausible configuration on under
/system/console/configMgr/

Or, can this be fixed through jackrabbit configuration?

Or should I use a proxy server that can allow only 1 concurrent POST per
url?

Has anyone encountered problems with concurrent POSTs to the same node? How
did you resolve?


On Thu, Feb 7, 2013 at 5:21 PM, Paul McMahon <or...@yahoo.com> wrote:

> I don't think that you'd really want Sling running in single threaded mode
> - your performance would rapidly become unusable.
>
> Given that error I assume this is a CQ instance. You might want to check
> with daycare - depending on which version of CQ you are one there might be
> hot fix that resolves that issue - I seem to recall one at least
> (specifically the on around replication data).
>
> Paul McMahon
>
>
> ________________________________
>  From: Sam Lee <sk...@gmail.com>
> To: users@sling.apache.org
> Sent: Thursday, February 7, 2013 10:23 AM
> Subject: single threaded mode?
>
> Hey,
>
> I am getting lots of:
> Caused by: org.apache.jackrabbit.core.state.StaleItemStateException:
> 30a33d9e-ed9a-42bf-a8c6-14c74b6b3858/{
> http://www.day.com/jcr/cq/1.0}lastReplicatedBy has been modified
> externally
>
> on different JCR items.
>
> How can I run sling in single threaded mode? Only one thread will write to
> the repository. Or, one servlet thread handles all concurrent HTTP requests
> (after queuing them up).
> Is this possible?
>

Re: single threaded mode?

Posted by Paul McMahon <or...@yahoo.com>.
I don't think that you'd really want Sling running in single threaded mode - your performance would rapidly become unusable.

Given that error I assume this is a CQ instance. You might want to check with daycare - depending on which version of CQ you are one there might be hot fix that resolves that issue - I seem to recall one at least (specifically the on around replication data). 

Paul McMahon


________________________________
 From: Sam Lee <sk...@gmail.com>
To: users@sling.apache.org 
Sent: Thursday, February 7, 2013 10:23 AM
Subject: single threaded mode?
 
Hey,

I am getting lots of:
Caused by: org.apache.jackrabbit.core.state.StaleItemStateException:
30a33d9e-ed9a-42bf-a8c6-14c74b6b3858/{
http://www.day.com/jcr/cq/1.0}lastReplicatedBy has been modified externally

on different JCR items.

How can I run sling in single threaded mode? Only one thread will write to
the repository. Or, one servlet thread handles all concurrent HTTP requests
(after queuing them up).
Is this possible?