-
Notifications
You must be signed in to change notification settings - Fork 199
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
@ references in commemorations can loop infinitely #525
Comments
#3869 shows the importance of addressing this. The usual way to prevent an infinite loop is to count how many references have been followed. When this nesting depth exceeds some value, e.g., 10, the code returns an error like "References too deeply nested" instead of continuing to follow references. |
Interesting issue; I've never understood what the original problem with the commemoratio3 was about. So thanks for explaining about the nesting issue. I guess the easiest way to avoid too deep nesting is to reference the actual text source as directly as possible, irrespective of the nesting in the breviary books? |
I would say that nesting should reflect the structure of the data in this repository. Since the repository does contain duplicated texts, it may not always be obvious which location is the definitive one to reference, so deep nesting could be created legitimately or at least in good faith. The problem isn't deep nesting, but circular nesting, and sometimes the circularity is not obvious. When the issue was reported, I ran into another case years ago was when I was trying to add an Italian translation (I never finished, and eventually someone provided a different translation). I saw that a particular common had texts that were duplicated between the Easter file for the common and the regular file for the common: I forget which it was, but let's say C6. So I put references in the Easter file (C6p) to the regular file (C6). An infinite loop ensued when Easter offices were generated. Why? When the program looked up the common, it saw it was Easter, so it opened C6p.txt and tried to retrieve a section. It found a reference to the corresponding section in C6. But it's Easter, so references to C6 should be interpreted as C6p. So it reopened C6p and found in the same place the same reference to C6, interpreted it as C6p, etc. The mechanism for commons in Easter has recently been changed, so the same thing wouldn't happen today, when C6p only contains things that are different from C6. These infinite loops in references tend to be pretty small: either something is referring to itself because of the way the program adjusts the reference, or perhaps there are two references that refer to each other. Until this issue is resolved, testing is important to make sure you don't render the server unusable. Even after the issue is resolved, you still have to test to make sure there's no error, but at least users will be able to see the rest of the office or Mass that's not affected by the circular reference, and the error won't cause high CPU usage on the server. |
Preventing some cause of infinite loops for Matins Gospel in Monastic
@d4h0y0sr The refactoring that has taken place over the past month has caused excessive cost overruns on the live site, specifically stemming from missa.pl. Please review all of your PRs that you have submitted and ensure proper references. Thank you. |
Do you have any clue to review this for testing?, I created a python script that I use to avoid loops in the references, until know i have not detect any unproper reference. |
@fiapps would this code generate a infinity loop? File: C6bp.txt
|
Are you using divinum_replay.pl? For the moment I would request the following adjustments be made to all refactored Missa texts:
|
What is divinum_replay? |
@d4h0y0sr See folder admin/divinum_replay.pl. It provides regression testing. |
I wouldn't expect this to produce an infinite loop, but I only work with the
This is the script used in conjunction with The most rigorous way to test is by using the Docker container to run a local server, but since the Dockerfile copies the contents of As for test cases, I maintain a set of over 1000 cases for testing my variant of |
Brute Force solution to #525 + Missa version names
Revert "Brute Force solution to #525 + Missa version names"
I dont use docker, I use WSL with perl installed and python. So if i understood well, this script will compare the content of my local copy vs the content of the website. I have a question about how to use this script, do you have an example with the parameters to run it over a certain mass? thanks |
As I said @d4h0y0sr, I don't use the |
Ok, first i think there could be a bug (or maybe something just with perl version): this line already do the encode: So if i want to do testing by myself, is this the testing algorithm?: Compare
would be enough for testing? @APMarcello3 could you help me by provide me examples of how to use replay script for mass? and also how to check the excessive cost overruns? i knew one of my PR cause an issue because a circular reference which i fixed the next day, but i have applied Benchmarking web page load time of the whole 2024 and i dont see any major issue. |
This method described by @fiapps above is now used by means of 8a16867 with a limit of 6 for the loop. Testing it with a self-reference, that still is a lot of CPU work before breaking out of it since there is exponential growth in the process in such a case. |
I wouldn't expect there to be any real need for references nested more than 2 or 3 deep. I can imagine one section (Y) using a reference to X with a substitution, and another section (Z) using a reference to Y because its content should be identical. That's only 2 levels deep. More levels could result from X being replaced with a reference at a later date, but there wouldn't be an inherent need for those extra levels, they would just be a side effect of reorganization that hadn't been thoroughly carried out. So I think a value less than 6 could work, but testing would be required to make sure nothing has been broken. Even a limit of 6 is probably a major cost savings, because I would expect a web server to let Perl run for something like 30–120 seconds before it decides to kill it automatically. |
I agree with you @fiapps and @FAJ-Munich I already have a list of the explicit references and all of them avoided more than 2 levels deep, I dont see this is an issue right now. Thats why i asked @APMarcello3, I could not find the issue he is mentioning about the excessive cost overruns, at least in the current state with my PR. So if there is not any issue reported I will continue with the translations and using references with the testing as i had done with my recents PR. |
including some additional safeguarding regarding paschaltide Commune reference for DivinumOfficium#525 pushing it further to be closed;
Pasc6-0 had this:
Infinite loop ensued.
The text was updated successfully, but these errors were encountered: