You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Ruwan Linton <ru...@gmail.com> on 2011/02/01 10:35:44 UTC

Re: Synapse file lock

Hi Momchil,

This is the expected behavior. Synapse reads its configuration from the
configuration files available in the repository/conf/synapse-config
directory and in Windows JVM take a lock when it opens the file descriptor.
This happens in the middle of starting Synapse server and once the
configuration building is done Synapse is going to release those file
descriptors and hence the JVM.

So after starting the server you can do those operations to the
configuration files. In general it is considered a bad practice to change
these files while synapse is starting.

May I know your use case so that I can see whether I can provide any help in
resolving the problem that you are trying to achieve with changing/deleting
the files while synapse is starting?

Thanks,
Ruwan

On Mon, Jan 31, 2011 at 9:07 PM, Atanassov, Momchil <
momchil.atanassov@sap.com> wrote:

> Hi there,
>
> I'm using Synapse 2.0 (30-Nov-2010 release, not the last build) and I'm
> having the following problem.
> Whenever I start Synapse I can't delete or modify any existing proxy,
> sequence, etc. files. Windows warns me that JVM has a lock on those files.
> The actual message is "The action can't be completed because the file is
> open in Java(tm) Platform SE binary.".
>
> However, deleting deployed resources that were added after synapse was
> started is no problem. Eventually (after some time) those files that were
> deployed at synapse startup get released and are available for
> deletion/modification but neither do I know when that will happen, nor do I
> have any control over it.
>
> Is this behavior expected? Is it an issue that you have resolved in the
> last builds? Any info is appreciated.
>
> Many thanks in advance,
> Momchil Atanasov
>
>
>


-- 
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
Software Architect & Product Manager, WSO2 Inc.; http://wso2.org

phone: +1 408 754 7388 ext 51789
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton

Re: Synapse file lock

Posted by Ruwan Linton <ru...@gmail.com>.
Andreas,

Well, you could be correct, I just had a look at the code and looks like we
are not closing the FileInputStream. At the same time, I was just thinking
if we do not build the document, can we really close the stream as AXIOM is
parsing the stream on-demand. So there is no clear place to close the stream
unless you build the whole XML document, (which we can do in this particular
case I assume :-))

Apart from that what I have experienced is even when we closed the stream
and released the file descriptor, Windows takes some time to release the
file handlers from the OS, where as Unix didn't.

Thanks,
Ruwan

On Tue, Feb 1, 2011 at 5:39 PM, Andreas Veithen
<an...@gmail.com>wrote:

> This sounds like input streams that are not properly closed by the
> code and that are only closed by the garbage collector.
>
> Andreas
>
> On Tue, Feb 1, 2011 at 10:35, Ruwan Linton <ru...@gmail.com> wrote:
> > Hi Momchil,
> >
> > This is the expected behavior. Synapse reads its configuration from the
> > configuration files available in the repository/conf/synapse-config
> > directory and in Windows JVM take a lock when it opens the file
> descriptor.
> > This happens in the middle of starting Synapse server and once the
> > configuration building is done Synapse is going to release those file
> > descriptors and hence the JVM.
> >
> > So after starting the server you can do those operations to the
> > configuration files. In general it is considered a bad practice to change
> > these files while synapse is starting.
> >
> > May I know your use case so that I can see whether I can provide any help
> in
> > resolving the problem that you are trying to achieve with
> changing/deleting
> > the files while synapse is starting?
> >
> > Thanks,
> > Ruwan
> >
> > On Mon, Jan 31, 2011 at 9:07 PM, Atanassov, Momchil <
> > momchil.atanassov@sap.com> wrote:
> >
> >> Hi there,
> >>
> >> I'm using Synapse 2.0 (30-Nov-2010 release, not the last build) and I'm
> >> having the following problem.
> >> Whenever I start Synapse I can't delete or modify any existing proxy,
> >> sequence, etc. files. Windows warns me that JVM has a lock on those
> files.
> >> The actual message is "The action can't be completed because the file is
> >> open in Java(tm) Platform SE binary.".
> >>
> >> However, deleting deployed resources that were added after synapse was
> >> started is no problem. Eventually (after some time) those files that
> were
> >> deployed at synapse startup get released and are available for
> >> deletion/modification but neither do I know when that will happen, nor
> do I
> >> have any control over it.
> >>
> >> Is this behavior expected? Is it an issue that you have resolved in the
> >> last builds? Any info is appreciated.
> >>
> >> Many thanks in advance,
> >> Momchil Atanasov
> >>
> >>
> >>
> >
> >
> > --
> > Ruwan Linton
> > Member, Apache Software Foundation; http://www.apache.org
> > Software Architect & Product Manager, WSO2 Inc.; http://wso2.org
> >
> > phone: +1 408 754 7388 ext 51789
> > email: ruwan@wso2.com; cell: +94 77 341 3097
> > blog: http://blog.ruwan.org
> > linkedin: http://www.linkedin.com/in/ruwanlinton
> > google: http://www.google.com/profiles/ruwan.linton
> > tweet: http://twitter.com/ruwanlinton
> >
>



-- 
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
Software Architect & Product Manager, WSO2 Inc.; http://wso2.org

phone: +1 408 754 7388 ext 51789
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton

Re: Synapse file lock

Posted by Andreas Veithen <an...@gmail.com>.
This sounds like input streams that are not properly closed by the
code and that are only closed by the garbage collector.

Andreas

On Tue, Feb 1, 2011 at 10:35, Ruwan Linton <ru...@gmail.com> wrote:
> Hi Momchil,
>
> This is the expected behavior. Synapse reads its configuration from the
> configuration files available in the repository/conf/synapse-config
> directory and in Windows JVM take a lock when it opens the file descriptor.
> This happens in the middle of starting Synapse server and once the
> configuration building is done Synapse is going to release those file
> descriptors and hence the JVM.
>
> So after starting the server you can do those operations to the
> configuration files. In general it is considered a bad practice to change
> these files while synapse is starting.
>
> May I know your use case so that I can see whether I can provide any help in
> resolving the problem that you are trying to achieve with changing/deleting
> the files while synapse is starting?
>
> Thanks,
> Ruwan
>
> On Mon, Jan 31, 2011 at 9:07 PM, Atanassov, Momchil <
> momchil.atanassov@sap.com> wrote:
>
>> Hi there,
>>
>> I'm using Synapse 2.0 (30-Nov-2010 release, not the last build) and I'm
>> having the following problem.
>> Whenever I start Synapse I can't delete or modify any existing proxy,
>> sequence, etc. files. Windows warns me that JVM has a lock on those files.
>> The actual message is "The action can't be completed because the file is
>> open in Java(tm) Platform SE binary.".
>>
>> However, deleting deployed resources that were added after synapse was
>> started is no problem. Eventually (after some time) those files that were
>> deployed at synapse startup get released and are available for
>> deletion/modification but neither do I know when that will happen, nor do I
>> have any control over it.
>>
>> Is this behavior expected? Is it an issue that you have resolved in the
>> last builds? Any info is appreciated.
>>
>> Many thanks in advance,
>> Momchil Atanasov
>>
>>
>>
>
>
> --
> Ruwan Linton
> Member, Apache Software Foundation; http://www.apache.org
> Software Architect & Product Manager, WSO2 Inc.; http://wso2.org
>
> phone: +1 408 754 7388 ext 51789
> email: ruwan@wso2.com; cell: +94 77 341 3097
> blog: http://blog.ruwan.org
> linkedin: http://www.linkedin.com/in/ruwanlinton
> google: http://www.google.com/profiles/ruwan.linton
> tweet: http://twitter.com/ruwanlinton
>