JODConverter Timeout Settings

1,275 views
Skip to first unread message

MaryAubaun

unread,
Apr 9, 2012, 7:57:55 PM4/9/12
to JODConverter
I use JODConverter to convert a lot of files, and would like to
understand how much control is possible with the timeouts. When
running a small file, a timeout of 20-30 seconds is enough. For
larger files, it may take 5-6 minutes to run.

Q1. Is there a way to set the timeout per conversion task, without
having to restart the managers? (Starting the managers and OpenOffice
takes a long time).

Q2. Does the timeout start when the call is made to:
officeManager.execute(conversionTask)?

Q3. I have subclassed StandardConversionTask and made my own
execute(...) function, which calls my loadDocument, getText, etc.
While my getText routine is running, I know that it's making progress,
and would like to reset the JOD timer to say "It's still alive", or
"if there is inactivity in the next 30 seconds, then consider it timed
out". Is there a way to do this with the current release, and if not,
can it be put into the next release?

Maybe what I'm looking for is an overall timeout limit (say, 15
minutes max for a file), plus an inactivity timer (if I don't reset a
timer in 30 seconds, consider my process as hung/dead). I can arrange
for the timers myself, so long as I can then call JOD and tell it
abort the task.

There may be a simpler solution than Q1-Q3. Any ideas and suggestions
are welcome.

hadv

unread,
Apr 10, 2012, 6:47:03 AM4/10/12
to jodcon...@googlegroups.com
Hi,

If you're using JODConverter 3.0.4; you can set execution timeout for each conversion task as below code:

DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
configuration.setTaskExecutionTimeout(Long.parseLong(taskExecutionTimeout));

taskExecutionTimeout is the timeout time in miliseconds.

gud luck!

MaryAubaun

unread,
Apr 10, 2012, 9:50:54 AM4/10/12
to JODConverter
I'm using the 3.0 beta, and followed the source code for
configuration.setTaskExecution(long ms), it seems to bind the values
at the time I call
officeManager = configuration.buildOfficeManager();

It calls
new ProcessPoolOfficeManager(xxx, including the task timeout)

which creates settings, and does

pooledManagers[i] = new PooledOfficeManager(settings);

Although I don't completely understand the code, it seems the task
timeout value is bound at the time the pool of office managers is
created.

I can do ((ProcessPoolOfficeManager)officeManager), but really need to
get the PooledOfficeManager that is being used to set the timeout
there.

I'm not sure if the correct plumbing is in place in the 3.0 version to
set per-task timeout. (Is the 3.0.4 version the same as the 3.0 beta
version?)

Dave H

unread,
Apr 17, 2012, 6:47:02 PM4/17/12
to JODConverter
Are there any timeout options in 2.2? I'm seeing an issue where i try
to convert doc/docx to PDF and the process never returns. I'm using
the OpenOfficeDocumentConverter class with a
SocketOpenOfficeConnection as my link..

Thanks!
Reply all
Reply to author
Forward
0 new messages