headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

Lukasz Szybalski
After testing it some more....

I did not see my application fail or get disconnected in non-headless mode.
I do see it failing in headless.

Here is the example from today.

Headless:
 /usr/bin/openoffice -accept="pipe,name=localhost_app;urp;" -norestore
-nofirstwizard -nologo -headless

INFO:MyApp:Starting my app
INFO:MyApp:Connection Set
INFO:MyApp:Connected to a Database
INFO:MyApp:Connected to a database, and have all the field names
INFO:MyApp:Connected to a database, and have all the field names
/usr/local/bin/4060/myfile.odt
INFO:MyApp:Created New Document: 40days.odt
INFO:MyApp:We have 20 Records from the database.
Traceback (most recent call last):
  File "/usr/local/bin/4060/4060.py", line 222, in <module>
    document2.store()
__main__.DisposedException: URP_Bridge : disposed
(tid=3) Unexpected connection closure




Now  /usr/bin/openoffice -accept="pipe,name=localhost_app;urp;"
-norestore -nofirstwizard -nologo
INFO:MyApp:Starting my app
INFO:MyApp:Connection Set
INFO:MyApp:Connected to a Database
INFO:MyApp:Connected to a database, and have all the field names
INFO:MyApp:Connected to a database, and have all the field names
/xxxx/4060/myfile.odt
INFO:MyApp:Created New Document: 40days.odt
INFO:MyApp:We have 20 Records from the database.
INFO:MyApp:Getting 55day  Records
INFO:MyApp:Got 55day  Records: 25
INFO:MyApp:Done.I am exiting



It works just fine.
Are there any differences in headless vs non-headless? Is there a
different mailing list I should be asking these questions? (headless
mailing list?)


 aptitude show openoffice.org-headless
Package: openoffice.org-headless
New: yes
State: installed
Automatically installed: no
Version: 1:2.4.1+dfsg-1
Priority: optional
Section: misc
Uncompressed Size: 2347k
Depends: openoffice.org-core (= 1:2.4.1+dfsg-1), libc6 (>= 2.7-1),
libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1),
         libstlport4.6ldbl
Description: Headless VCL plugin for OpenOffice.org
 OpenOffice.org is a full-featured office productivity suite that
provides a near drop-in replacement for Microsoft(R)
 Office.


maybe I should try go-oo.org?

Thanks,
Lucas


On Mon, Nov 9, 2009 at 11:34 AM, Lukasz Szybalski <[hidden email]> wrote:

> On Mon, Nov 9, 2009 at 9:01 AM, Etienne Gaudrain <[hidden email]> wrote:
>> Hi Lucas,
>>
>> Here are two things you may try :
>>
>> - use a pipe connection instead of a socket connection, and see if you still
>> lost connection
>>
>
> ok. lets try the pipe..
> What is the difference between socket and a pipe as far as oo?  Can I
> start multiple instances of oo with different pipe names and then use
> these pipe names for multiple programs that start around the same
> time?
>
>
> doing....
> changed the startup from
>
> /usr/bin/openoffice -accept="socket,host=localhost,port=8100;urp;"
> -norestore -nologo -headless -nofirstwizard
> to
> /usr/bin/openoffice -accept="pipe,name=localhost_app;urp;" -norestore
> -nofirstwizard -nologo -headless
>
>
> Now in the code I did:
>
> import uno
> from com.sun.star.beans import PropertyValue
> from com.sun.star.connection import NoConnectException
> localContext = uno.getComponentContext()
> resolver     = localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver",
> localContext)
> context      = None
> context = resolver.resolve("uno:pipe,name=localhost_app;urp;StarOffice.ComponentContext")
> desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop",
> context)
>
>
> but still get the connection lost....no change...(I wonder if I can
> use the NoConnectException somehow??)
>
> troubleshooting....
>
> I've tried recreating the cursor every time the new section/action
> needs to be done. This has improved the process but still 1/5 fail in
> headless.
> What I noticed is that if headless process crashes, I can start the
> non-headless process and that will finish just fine, so it seems as
> headless startup will lose connection more often then the non headless
> one.
>
> Since I start and stop oo from the script I really need to get the
> headless package to work properly.
>
>
>> - check that the OOo process is still running. Actually, you may want to use
>> the subprocess module instead of the os one (you just be loosing
>> compatibility with Python 2.3). You would be able to grab errors from the
>> stderror channel of your process. I don't know if it throw any message
>> there, but in case it does, you'd be able to read it.
>
> There are no error messages when oo crashes. If I start the oo on the
> socket then process is still running but its no longer listening on
> the socket.
> This will show a lot of soffice processes after few days of running
> the process in cron....   ps -ea | grep soffice
> But this command will show that none of them are listening
> anymore...netstat -atpen | grep soffice
>
> As far as pipe, i see its closing right now but I would need few days
> to see if the process closes when using cron?
>
> Ideas?
> Thanks,
> Lucas
>
>
>>
>>
>> Regards,
>> -Etienne
>>
>>
>> Lukasz Szybalski wrote:
>>>
>>> On Mon, Nov 9, 2009 at 2:29 AM, Kay Ramme <[hidden email]> wrote:
>>>
>>>>
>>>> Hi Lukasz,
>>>>
>>>> this is a Python question, right?
>>>>
>>>> Typically connections die, because one of the hosts get disconnected or
>>>> one
>>>> of the applications do terminate.
>>>>
>>>> Do you have a hint, which case is yours?
>>>>
>>>>
>>>
>>> It seems as there is a exception in openoffice services. Service
>>> terminates without sending back an error message, and its no longer
>>> listening on the port.
>>>
>>> When that happens I get a message on the next oo call that the
>>> connection was lost. So at this point I'm looking for a way for oo to
>>> tell me that it failed, or look at some log that oo? creates to see
>>> why it failed? Is there a log for the headless services oo is running?
>>>
>>> Thanks,
>>> Lucas
>>>
>>>
>>>
>>>>
>>>
>



--
Setup CalendarServer for your company.
http://lucasmanual.com/mywiki/CalendarServer
Automotive Recall Database - See if you vehicle has a recall
http://lucasmanual.com/recall

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

stephan.bergmann
On 11/12/09 18:49, Lukasz Szybalski wrote:
> I did not see my application fail or get disconnected in non-headless mode.
> I do see it failing in headless.
[...]
> Are there any differences in headless vs non-headless? Is there a
> different mailing list I should be asking these questions? (headless
> mailing list?)

I asked Philipp Lohmann from the VCL team (relevant list would be
[hidden email]) if he knows about any stability issues with
headless mode, but he had nothing to offer.  If the cause for the
unexpected connection closure is a crash of OOo, I guess you will need
to attach a debugger to OOo so we can find out more.

>  aptitude show openoffice.org-headless
> Package: openoffice.org-headless
> New: yes
> State: installed
> Automatically installed: no
> Version: 1:2.4.1+dfsg-1
> Priority: optional
> Section: misc
> Uncompressed Size: 2347k
> Depends: openoffice.org-core (= 1:2.4.1+dfsg-1), libc6 (>= 2.7-1),
> libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1),
>          libstlport4.6ldbl
> Description: Headless VCL plugin for OpenOffice.org
>  OpenOffice.org is a full-featured office productivity suite that
> provides a near drop-in replacement for Microsoft(R)
>  Office.
>
> maybe I should try go-oo.org?

Reportedly, go-oo used a different implementation of headless than
vanilla OOo in the past, but probably have converged to the vanilla one
by now.  (But the above output suggests that you still use OOo 2.4.1,
which is really old.  Use OOo 3.1.1 or snapshots of the forthcoming OOo
3.2 instead!)  In any event, if you are using OOo based on the go-oo
fork, it is probably best to ask there first.

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

Kay Ramme - Sun Germany - Hamburg
Ahhh, I missed this mail ;-)

As Stephan said, it is probably better to ask on the go-oo lists or to
switch to vanilla (http://download.openoffice.org).

Regards

      Kay


Stephan Bergmann wrote:

> On 11/12/09 18:49, Lukasz Szybalski wrote:
>> I did not see my application fail or get disconnected in non-headless
>> mode.
>> I do see it failing in headless.
> [...]
>> Are there any differences in headless vs non-headless? Is there a
>> different mailing list I should be asking these questions? (headless
>> mailing list?)
>
> I asked Philipp Lohmann from the VCL team (relevant list would be
> [hidden email]) if he knows about any stability issues with
> headless mode, but he had nothing to offer.  If the cause for the
> unexpected connection closure is a crash of OOo, I guess you will need
> to attach a debugger to OOo so we can find out more.
>
>>  aptitude show openoffice.org-headless
>> Package: openoffice.org-headless
>> New: yes
>> State: installed
>> Automatically installed: no
>> Version: 1:2.4.1+dfsg-1
>> Priority: optional
>> Section: misc
>> Uncompressed Size: 2347k
>> Depends: openoffice.org-core (= 1:2.4.1+dfsg-1), libc6 (>= 2.7-1),
>> libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1),
>>          libstlport4.6ldbl
>> Description: Headless VCL plugin for OpenOffice.org
>>  OpenOffice.org is a full-featured office productivity suite that
>> provides a near drop-in replacement for Microsoft(R)
>>  Office.
>>
>> maybe I should try go-oo.org?
>
> Reportedly, go-oo used a different implementation of headless than
> vanilla OOo in the past, but probably have converged to the vanilla one
> by now.  (But the above output suggests that you still use OOo 2.4.1,
> which is really old.  Use OOo 3.1.1 or snapshots of the forthcoming OOo
> 3.2 instead!)  In any event, if you are using OOo based on the go-oo
> fork, it is probably best to ask there first.
>
> -Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

Lukasz Szybalski
On Mon, Nov 16, 2009 at 1:09 AM, Kay Ramme <[hidden email]> wrote:
> Ahhh, I missed this mail ;-)
>
> As Stephan said, it is probably better to ask on the go-oo lists or to
> switch to vanilla (http://download.openoffice.org).
>


So, I've upgraded to the 3.1 version of OO. This seem to fixed
temporarily the issue, I run it twice right now and it seems to work,
I'll know more in a week or so.

Added to /etc/apt/source.list
deb http://www.backports.org/debian lenny-backports main contrib non-free

then apt-get update
and  apt-get -t lenny-backports install openoffice.org


But....the new version introduced huge memory consumption. In my
program I get a template odt file, I find and replace things in it,
save it and attached the temp.odt file to main file. When that is done
I discard the original temp.odt file and start again. In 2.4 I could
do around 150 iterations of these attachments without going over 40%
on memory (1gb).  Now with 3.1 my process is using 2.3GB right now
with 40 pages.

Is there a change in the dispose() function? or something along these lines?
Is there a better way to attach pages then insertDocumentFromURL?

Thanks,
Lucas

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

Kay Ramme - Sun Germany - Hamburg
Hi Lukasz,

could you give a brief overview over your system, the OS, the arch and
the OOo version etc.? That would help debugging this. You find the
detailed OOo version in the "about" dialog.


Regards

      Kay


Lukasz Szybalski wrote:
> On Mon, Nov 16, 2009 at 1:09 AM, Kay Ramme <[hidden email]> wrote:


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

Lukasz Szybalski
On Thu, Nov 19, 2009 at 1:26 AM, Kay Ramme <[hidden email]> wrote:
> Hi Lukasz,
>
> could you give a brief overview over your system, the OS, the arch and the
> OOo version etc.? That would help debugging this. You find the detailed OOo
> version in the "about" dialog.

The upgraded version is :

3.1.1.1-1bpo50+1 sat sept 2009

The memory problem is again in the headless portion.

If I run the program in non-headless package the memory consumption
stays the same.  When program loads the odt template the memory
increases by 2% , but when the file is dispose() the memory goes back
down by 2%. In headless mode the memory just keeps going up by 2%
every time a file is loaded and dispose()


If I new a command that would save a memory usage for a process and
save the new values every 5 sec, I would draw you guys a graph to show
how memory is going up.

Somebody mentioned I could attached a debugger to oo? How would I do
that? Is that a command argument that I just add or?

Any ideas on memory usage, and how to fix it?

Thanks,
Lucas

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

Gabriel Monnerat
Lukasz Szybalski wrote:

> On Thu, Nov 19, 2009 at 1:26 AM, Kay Ramme <[hidden email]> wrote:
>  
>> Hi Lukasz,
>>
>> could you give a brief overview over your system, the OS, the arch and the
>> OOo version etc.? That would help debugging this. You find the detailed OOo
>> version in the "about" dialog.
>>    
>
> The upgraded version is :
>
> 3.1.1.1-1bpo50+1 sat sept 2009
>
> The memory problem is again in the headless portion.
>
> If I run the program in non-headless package the memory consumption
> stays the same.  When program loads the odt template the memory
> increases by 2% , but when the file is dispose() the memory goes back
> down by 2%. In headless mode the memory just keeps going up by 2%
> every time a file is loaded and dispose()
>
>
> If I new a command that would save a memory usage for a process and
> save the new values every 5 sec, I would draw you guys a graph to show
> how memory is going up.
>
> Somebody mentioned I could attached a debugger to oo? How would I do
> that? Is that a command argument that I just add or?
>
> Any ideas on memory usage, and how to fix it?
>  
Hi Lucas,
I had this same problem of memory. In my case it consumed all the RAM
and SWAP and then returned to DisposedException exception. To solve this
problem I did with my application never kept one in the memory forever.

In Python I created a script that used the UNO and my tool called this
script as if it were a command. For example:

unoconverter.py
[code]
import uno

... do something with uno ....

return response
[/code]

service.py
[code]
stdout, stderr = subprocess.Popen("./unoconverter.py --arguments",
shell=True, stdout=PIPE, stderr=PIPE).communicate()
[/code]

Thus, when the UNO is removed from memory and after each time the
openoffice is used the memory used is deallocated.
> Thanks,
> Lucas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>  


--
Gabriel M. Monnerat


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

stephan.bergmann
In reply to this post by Lukasz Szybalski
On 11/19/09 21:59, Lukasz Szybalski wrote:

> On Thu, Nov 19, 2009 at 1:26 AM, Kay Ramme <[hidden email]> wrote:
>> Hi Lukasz,
>>
>> could you give a brief overview over your system, the OS, the arch and the
>> OOo version etc.? That would help debugging this. You find the detailed OOo
>> version in the "about" dialog.
>
> The upgraded version is :
>
> 3.1.1.1-1bpo50+1 sat sept 2009
>
> The memory problem is again in the headless portion.

That is probably <http://qa.openoffice.org/issues/show_bug.cgi?id=105191>.

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: headless package closes connection - was Re: [udk-dev] (tid=3) Unexpected connection closure

Lukasz Szybalski
On Mon, Nov 23, 2009 at 2:40 AM, Stephan Bergmann
<[hidden email]> wrote:

> On 11/19/09 21:59, Lukasz Szybalski wrote:
>>
>> On Thu, Nov 19, 2009 at 1:26 AM, Kay Ramme <[hidden email]> wrote:
>>>
>>> Hi Lukasz,
>>>
>>> could you give a brief overview over your system, the OS, the arch and
>>> the
>>> OOo version etc.? That would help debugging this. You find the detailed
>>> OOo
>>> version in the "about" dialog.
>>
>> The upgraded version is :
>>
>> 3.1.1.1-1bpo50+1 sat sept 2009
>>
>> The memory problem is again in the headless portion.
>
> That is probably <http://qa.openoffice.org/issues/show_bug.cgi?id=105191>.
>


Indeed.
This is a somewhat critical problem for me.
I wonder how soon will the solution be available.

Thanks,
Lucas

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]