OCR-D / ocrd-demo-mets-server

4 stars 1 forks source link

idea: add error handling with timeout #1

Open bertsky opened 10 months ago

bertsky commented 10 months ago

In the parallel case, we could rewrite the background process command as a sequence, falling back to some ocrd-dummy (for the same page range) if the actual processor fails (or times out).

kba commented 10 months ago

dummy-on-timeout.sh:

processor=$1; shift;
timeout 60 $processor $@ || ocrd-dummy $@

And then

make PROCESSOR=dummy-on-timeout.sh

Like this?

bertsky commented 10 months ago

More like:

parallel: $(WS_PAR)/mets.xml
    cd $(WS_PAR) ; \
    ocrd workspace list-page | parallel -j $(NUMBER_OF_THREADS) "timeout $(PAGE_TIMEOUT) $(PROCESSOR) -U $(SOCK) -I DEFAULT -O VANDALIZED -g {} || $(ECHO) ocrd-dummy -U $(SOCK) -I DEFAULT -O VANDALIZED -g {}"
kba commented 8 months ago

Reopening because we want this in core