Page MenuHomePhabricator

Image transformation may race itself for long/slow transforms
Closed, ResolvedPublic

Description

See note in T5258. The transform process may race itself:

  • Two requests start generating a transform at around the same time.
  • They both check for a cached transform, and both miss.
  • The transform takes many seconds to generate, since it's a huge GIF with a bunch of text on it.
  • The last request to finish hits a primary key error when saving the transform.

If we hit a duplicate key error and fail to save the transform, we probably need to load the transform we lost to and respond as though we had generated it. If we use the transform we just generated, it may not have proper permissions (in the future, if not now) because it lacks the row marking it as a transform.