-
Notifications
You must be signed in to change notification settings - Fork 21
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
Template Compilation Error #41
Comments
Oh. Sorry to here this. I think this is likely related to #32 . Will have to see if I discover something. |
Some times it works, and some times it doesn't, right? (your template) |
And the error occurs always in the same template? |
One thing to try if you are running production, is to do:
before asdf:require your system. That tells Djula to not look at the status of templates on disk and never recompile. Perhaps that helps. |
Precisely.
In anyone of four different templates, but those are the only ones I use and they all have some {%} elements.
I'll try that and report back. |
I think that the djula push have helped (I'm usually running with a connected repl, so sometimes one is not 100% sure of the state of all variables when an error occured). I'm happy with what seems like quick-fix, but if there is something more I can do I'd be glad to help. |
I'm glad you are glad to help :) Well, for a start, if the Line 49 in 594837c
|
Anyway, it's good to run with |
And I should document that feature, btw. |
I think I have triggered the error even with :djula-prod on. At least 90% sure it was on (it is set when the program launches but I couldn't confirm the value once the error showed up). I don't know if this clears or obscures the picture. My hunch was that the error has occurred with much lower frequency after :djula-prod. But again, not being able to reliantly trigger the error is annoying. |
Mm. Ok. This is tricky. I think one thing we could do is try to automate this. Take a template and call render-template* thousands of times, until it breaks, or revise the memory somehow if we have the chance. |
I'm trying this myself but nothing happens. I can't reproduce.
Perhaps you can try something similar with you templates? |
Using the same code as you, but with all four templates where I have confirmed errors. Neither I can reproduce the error with or without (push :djula-prod features). The (room) output looks similar. But I have still seen the error in the last two weeks when running the server. I don't know what to do here. I have moved my "looping logic", I now have new templates without the "{%for%}", so I can avoid the error. I am open to:
Is it conceivable that the error is not in djula, but djula happens to catch the error? |
I think we should leave this open as it is not solved. I don't know if it's possible that Djula catches and error that is not in Djula; to me this sounds like a problem in Djula. I have a suspicion on the expression parser used for ifs and fors, that is implemented using parser combinators, that it may be leaking memory, but I would have to test. Not sure how else to test this, apart from repeating the tests with bigger numbers, like loop repeat 10000000, etc, and with changing conditions on the templates (giving templates different data each time). And also, it would be cool if you could observe the memory consumption of your production application, I guess that could give us a clue if you verify that memory consumption increases along the week. Btw, are you using SBCL --dynamic-space-size option? |
Actually, now that I look, it may be that you don't have a heap exhaustion problem, but some other problem, and Djula is trying to catch it.
Djula is compiling the error-template.djhtml there, to show the error. Can you paste a more complete backtrace of the errors here in the future? |
doesn't trigger it either. Anyway, I'm under the impression that it has occured so often that already 1000 loops certainly should have caught it, if it would ever happen. I have observed the error with
Let's decide that I run one instance of the server without djula-prod (just for the sake of it) and with the old templates until I get the error again. Then I'll try to document the hell out of it and post it here. |
Complete backtrace. There might be a tendency that the problem occurs when there is much/more data in the call to the template. |
Aha. It's a memory fault error on render-template, but I'm still clueless, sorry. :/ |
`
Template Compilation Error
Unhandled memory fault at #x0..
In #<COMPILED-TEMPLATE /var/username/.roswell/lisp/quicklisp/dists/quicklisp/software/djula-20170227-git/templates/error-template.djhtml {20629C3B}>.
Date/time: 2017-08-08-08:00An unhandled error condition has been signalled:
Unhandled memory fault at #x0.
Backtrace for: #
0: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE-TO-STREAM #)
1: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE # :OUTPUT NIL :IF-EXISTS :APPEND :VERBOSE NIL)
2: #
`
Error is thrown when a webserver (cavemanbased, just like in #32, related?) calls one of several templates that loops and plots some javascript. The template doesn't have any {%include%} or {%if%}, but some {%for%} loops.
I have severe problems to reproduce the error, but once it shows up, calling that template will produce the same error until the whole process is killed.
The error have been present for several months, but since I have had such problems pinpointing it have felt hesitant to report it until now.
The text was updated successfully, but these errors were encountered: