Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

bug 766252: Deferred and singleton page rendering#318

Merged
groovecoder merged 1 commit into
mdn:masterfrom
lmorchard:page-rebuild-queue-task-766252
Jul 2, 2012
Merged

bug 766252: Deferred and singleton page rendering#318
groovecoder merged 1 commit into
mdn:masterfrom
lmorchard:page-rebuild-queue-task-766252

Conversation

@lmorchard
Copy link
Copy Markdown
Contributor

Dropping this bomb of a PR now and then stepping away from it for awhile. There's a lot here. I recommend reading all the commit log bullet points, and then review the tests before digging into any other code. This should run both with and without a Celery queue and celeryd running.

  • Documents can be rendered on demand or offloaded into the Celery queue
    • Documents with defer_rendering == True are rendered with Celery
      queue tasks. Otherwise, rendering is attempted on demand during
      the request/reasponse cycle.
    • If a Document takes too long to render, defer_rendering is
      automatically set to True. This time limit is controlled by
      KUMA_DOCUMENT_FORCE_DEFERRED_TIMEOUT in Constance settings
  • Allow only one rendering per Document at any given time. Additional
    attempts to render a Document while already in progress results in a
    warning message and/or stale content while the rendering finishes.
  • Rendered content is now kept in the DB, rather than temporary cache
  • Lots of additional Document fields to track rendering state, store
    rendered content, and control deferred rendering.
  • Reload no longer triggers a render of the page. However, editing and
    saving a Document does.
  • Shift-Reload by a logged-in user schedules a fresh render, assuming
    there's not one already in progress.
  • Display warning messages about the render status of a page. But, only
    for logged-in users to keep search engine crawlers from indexing them.
  • Display detailed Kumascript errors only to logged in users, also to
    avoid search indexing.
  • Document rendering via kumascript refactored out of views.py and into
    models.py and kumascript.py
  • Disable schedule_rebuild_kb and _maybe_schedule_rebuild in favor of
    new Document rendering system.
  • Tweaks to Document admin to allow mass enable/disable of deferred
    rendering, link to public URL of Documents.
  • Reenable celery queue in settings_local, tweaks to failing tests
  • manage.py command for manually triggering or queuing a page render

@lmorchard
Copy link
Copy Markdown
Contributor Author

Oh also, this should fix https://bugzilla.mozilla.org/show_bug.cgi?id=765649

Comment thread apps/wiki/models.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add:

if not self.defer_rendering:
    return False

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This function is about whether a rendering has been scheduled, which is valid whether or not the document should be rendered in the offline queue. (ie. A rendering is considered scheduled, even if it happens on-demand in the request/response cycle)

* Documents can be rendered on demand or offloaded into the Celery queue

    * Documents with `defer_rendering == True` are rendered with Celery
      queue tasks. Otherwise, rendering is attempted on demand during
      the request/reasponse cycle.

    * If a Document takes too long to render, `defer_rendering` is
      automatically set to True. This time limit is controlled by
      KUMA_DOCUMENT_FORCE_DEFERRED_TIMEOUT in Constance settings

* Allow only one rendering per Document at any given time. Additional
  attempts to render a Document while already in progress results in a
  warning message and/or stale content while the rendering finishes.

* Rendered content is now kept in the DB, rather than temporary cache

* Lots of additional Document fields to track rendering state, store
  rendered content, and control deferred rendering.

* Reload no longer triggers a render of the page. However, editing and
  saving a Document does.

* Shift-Reload by a logged-in user schedules a fresh render, assuming
  there's not one already in progress.

* Display warning messages about the render status of a page. But, only
  for logged-in users to keep search engine crawlers from indexing them.

* Display detailed Kumascript errors only to logged in users, also to
  avoid search indexing.

* Document rendering via kumascript refactored out of views.py and into
  models.py and kumascript.py

* Disable schedule_rebuild_kb and _maybe_schedule_rebuild in favor of
  new Document rendering system.

* Tweaks to Document admin to allow mass enable/disable of deferred
  rendering, link to public URL of Documents.

* Reenable celery queue in settings_local, tweaks to failing tests

* manage.py command for manually triggering or queuing a page render
@lmorchard
Copy link
Copy Markdown
Contributor Author

I just did a rebase with current master, and fixed the missing url in apps/wiki/templates/wiki/document.html

groovecoder added a commit that referenced this pull request Jul 2, 2012
bug 766252: Deferred and singleton page rendering
@groovecoder groovecoder merged commit 7219dc9 into mdn:master Jul 2, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants