Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Losing stderr when running multiple clients at once #316

Open
uniwisejohannes opened this issue Oct 11, 2024 · 1 comment
Open

Losing stderr when running multiple clients at once #316

uniwisejohannes opened this issue Oct 11, 2024 · 1 comment

Comments

@uniwisejohannes
Copy link

uniwisejohannes commented Oct 11, 2024

Sorry if this is silly, but we wanted to hear the developer's thoughts on this.

In our project we initialise 4 different gosseract.Clients one at a time using gosseract.NewClient, and then for each of these clients we have a Go routine in which we call SetImageFromBytes and GetBoundingBoxes on a client. Each of these threads are consuming a lot of documents that they are processing one at a time (so 4 at a time sometimes).

This seemingly corrupts stderr so that we lose all the logs in our system.

Is it just not possible to run 4 seperate TessBaseAPIs at once?

We are using ENV OMP_THREAD_LIMIT=1 in our Dockerfile and our pod has 4 cores.

We also have RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o /build/bin/service main.go

Our image base is debian:12

@otiai10
Copy link
Owner

otiai10 commented Oct 14, 2024

That's because gosseract currently hijacks stderr.
This was a workaround when we implemented gosseract, and we don't believe this is the best way.
We need to identify the best way. Meanwhile, I'm thinking about opt-out the stderr hijack.
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants