-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Notifications: duplicate messages #11131
Comments
cc @humitos I don't know if we've fixed this yet or not |
Without jumping too much on this yet:
So, working on 2) to call |
I think this is because we implemented permissions on notifications in the last deploy (see #11117) and there may be a bug on it because those notifications should be shown to all the users, since the build is public. |
In [12]: Notification.objects.filter(message_id=BuildMaxConcurrencyError.LIMIT_REACHED, format_values={}).count()
Out[12]: 4595
In [13]: Notification.objects.filter(message_id=BuildMaxConcurrencyError.LIMIT_REACHED).exclude(format_values={}).count()
Out[13]: 43746 It seems somewhere we are creating this notification without the proper readthedocs.org/readthedocs/projects/tasks/builds.py Lines 362 to 374 in 0a381a7
|
This is probably worth a separate issue, but I've noticed these build concurrency notifications on a number of builds too. Shouldn't these notifications clear after the build is successfully started? I've noticed these in a few spots, but it's hard for me to tell if this should be resolved now or not. The above error is on my local instance on a finished build -- same with the original errors I posted here. I suppose also these should be warning level notifications? That would at least help make it clear that the build is not failed. |
I've done this in #11196 |
Yes, I've mentioned this in 1) from my previous comment #11131 (comment) |
This is done in #11197 |
Now, with the two PRs I've opened I think this issue shouldn't be an issue anymore. However, 1) could be still present sometimes due to network issues/web instance congestion or similar scenarios where the |
That comment implied to me that the messages would only be deduplicated with the fix -- ie:
Are you saying that this fix is also what will dismiss the notification once the build has started? To clarify, what I would expect here is that while the build is still queued that warning message should show, but once the build is no longer queued due to concurrency limits the message will disappear. |
Yes, this is how it should work. However, even with all these fixes... the scenario I mentioned before, may be still present on some edge cases 👇🏼
|
* Notifications: de-duplicate them when using APIv2 from builders Related #11131 * Update readthedocs/notifications/querysets.py Co-authored-by: Santos Gallegos <[email protected]> --------- Co-authored-by: Santos Gallegos <[email protected]>
I found this issue in https://readthedocs.org/projects/docs/builds/23722719/ as well. This was a recent build in our own documentation. I still don't understand why this is happening, but it's worth investigating it a little more. |
We should probably run a small Python code from Django shell to remove these notifications from builds that are in finished state. |
This would be Python code we could run in production to remove these invalid notifications from builds: from readthedocs.builds.constants import (
BUILD_STATE_FINISHED,
BUILD_STATE_CANCELLED,
)
from readthedocs.doc_builder.exceptions import BuildMaxConcurrencyError
for n in Notification.objects.filter(message_id=BuildMaxConcurrencyError.LIMIT_REACHED).prefetch_related("attached_to"):
if n.attached_to.state in (BUILD_STATE_FINISHED, BUILD_STATE_CANCELLED):
n.delete() |
I think I found why we are not resetting the build in some cases: readthedocs.org/readthedocs/projects/tasks/builds.py Lines 449 to 453 in a0526ff
We are only resetting it if has at least one command already. We should remove that restriction 👍🏼 |
* Build: always reset the build before building Closes #11131 * Mock the APIv2 reset endpoint for testing * Update tests
The duplicated "concurrecy limit" notifications deleted and they should not appear again in new builds. As example, the old build linked in this issue doesn't show it anymore: https://beta.readthedocs.org/projects/xclim/builds/23494705/ |
Noticed here:
https://beta.readthedocs.org/projects/xclim/builds/23494705/
The error messages seem to stack here:
Also not sure why the string interpolation fails for these, I've noticed that in a few spots though.
On the current dashboard there are no notifications though, not sure why.
https://readthedocs.org/projects/xclim/builds/23494705/
The text was updated successfully, but these errors were encountered: