There's a race condition with the Ooyala module that is very easy to run into with short videos or long content forms. If node auto-publishing is enabled, the workflow usually goes something like this:
- User starts uploading a video. Drupal gets an embedcode for the video being uploaded.
- Node is saved to Drupal.
- When the video is processed, Ooyala pings Drupal, and Drupal fetches information for the video.
The problem is if the ping is sent before the node is saved. Drupal doesn't have the embedcode saved, and discards the ping. Instead, we should keep pings around, but have some sort of timeout or retry count. Then, Drupal can see if the node has been saved, and refresh from Ooyala.
This could also be solved by publishing the node automatically when the node is saved. A queue system benefits us in that it also solves a series of other issues including:
- Keeping pings in the queue if we can't successfully connect back to Ooyala.
- Manually refreshing all content for cases where the site was offline or the network connection was broken.
- Handling the loss of an embedcode when Ooyala marks an upload as a duplicate after saving a node (new issue, but I think a queue is a good way to go).
I'm planning on using the D7 queue API and the D6 backport at drupal_queue for the 6.x-1.x version.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1407196.3-ping-queue-6.x.patch | 18.45 KB | deviantintegral |
| #2 | 1407196.2-ping-queue.patch | 47.38 KB | deviantintegral |
| #1 | 1407196.1-ping-queue.patch | 40.56 KB | deviantintegral |
Comments
Comment #1
deviantintegral commentedHere's an initial patch that implements the following changes. Highlights include:
Here's the commit log:
Comment #2
deviantintegral commentedHere's a new patch that adds the following commits.
I'm pretty happy with this. I'm going to push these up to the 7.x-1.x branch. A 6.x-1.x patch will follow shortly.
Comment #3
deviantintegral commentedHere is the 6.x backport that I've been developing concurrently. This consists of a single commit with all of the changes from the 7.x patch, followed with a commit for drupal_queue support: