-
Notifications
You must be signed in to change notification settings - Fork 181
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
ERROR_DELEGATE running ghostscript, only after a period of use #164
Comments
First, can you move the imagick.Initialize() and terminate out of your handler and into the main goroutine for your http server? It is a common mistake. You don't want to have your Web requests contending to start up and tear down ImageMagick every time. I think I have seen this before when pdf are corrupt. Have you managed from your logs to isolate the pdf that breaks it and inspect that file? It's a shame to hear that the entire server stops working after this happens. |
I had the there in hope that it would fix this error (given the nature of the problem I thought it might have some affect), but it didn't make any difference. It seems to be under a sufficient load that this happens. That looked like a race condition to me, so for the sake of narrowing it down I threw a mutex lock around the whole function. Unfortunately it still happens :/ |
I should also clarify that I am using the legacy version of ImageMagick. I'm going to try upgrading to 6.9.9 tonight (right now the server is on 6.8.9), and see if that makes any difference. I feel like the way this issue persists indicates there's something terribly wrong with either ImageMagick itself or the MagicWand library. I mean, Ghostscript might fail once but it definitely doesn't keep doing it (under my assumption that imagemagick executes the program separately each time it needs to use it) |
Its a good idea to focus on ImageMagick here, like you said. The only time I see delegate issues is with wrong library versions or ImageMagick bugs. Or running imagick in a alpine docker image with musl compiler |
Could there be any issue with |
I posted an issue on the ImageMagick GitHub as well: ImageMagick/ImageMagick6#2 |
I haven't studied that part of the source, but I assumed it was a field on the wand that stores the error result of the last call using that wand. |
Closing via the issue posted on the ImaegMagick issue tracker |
I have an HTTP server written in Go that uses this library to convert pages of PDF into images and save them on disk.
It works fine, but after a day or so of use the script begins consistently reporting an error. It may be a specific PDF file that initially triggers it, but I'm not sure yet.
This is the error that's thrown:
Restarting the Go server consistently fixes the problem until it happens again. After the first time the error occurs, no further attempts are successful until the Go server is restarted.
This is the entire function for processing the PDF:
The text was updated successfully, but these errors were encountered: