bumptech/glide · error · IllegalArgumentException

Cannot restart a running request

Error message

Cannot restart a running request

What it means

Thrown by SingleRequest.begin() when begin() is invoked while the request status is already RUNNING. A SingleRequest represents one in-flight load and cannot be restarted from the running state; it must be cleared first. Calling begin() again on a complete request is allowed (it short-circuits to the cached resource), but a running one is a programming error.

Source

Thrown at library/src/main/java/com/bumptech/glide/request/SingleRequest.java:235

  public void begin() {
    synchronized (requestLock) {
      assertNotCallingCallbacks();
      stateVerifier.throwIfRecycled();
      startTime = LogTime.getLogTime();
      if (model == null) {
        if (Util.isValidDimensions(overrideWidth, overrideHeight)) {
          width = overrideWidth;
          height = overrideHeight;
        }
        // Only log at more verbose log levels if the user has set a fallback drawable, because
        // fallback Drawables indicate the user expects null models occasionally.
        int logLevel = getFallbackDrawable() == null ? Log.WARN : Log.DEBUG;
        onLoadFailed(new GlideException("Received null model"), logLevel);
        return;
      }

      if (status == Status.RUNNING) {
        throw new IllegalArgumentException("Cannot restart a running request");
      }

      // If we're restarted after we're complete (usually via something like a notifyDataSetChanged
      // that starts an identical request into the same Target or View), we can simply use the
      // resource and size we retrieved the last time around and skip obtaining a new size, starting
      // a new load etc. This does mean that users who want to restart a load because they expect
      // that the view size has changed will need to explicitly clear the View or Target before
      // starting the new load.
      if (status == Status.COMPLETE) {
        onResourceReady(
            resource, DataSource.MEMORY_CACHE, /* isLoadedFromAlternateCacheKey= */ false);
        return;
      }

      // Restarts for requests that are neither complete nor running can be treated as new requests
      // and can run again from the beginning.

      experimentalNotifyRequestStarted(model);

View on GitHub (pinned to eb14a895d8)

Solutions

  1. Call Glide.with(view).clear(target) (or RequestManager.clear(target)) before starting a new load into the same Target/View
  2. Let Glide manage the request lifecycle via into(ImageView) which clears the previous request automatically — avoid managing SingleRequest instances yourself
  3. If holding a Request reference, check request.isRunning() before begin() and clear() if needed
  4. In RecyclerView, use a stable request per ViewHolder and clear in onViewRecycled

Example fix

// before
fun bind(url: String) {
  Glide.with(itemView).load(url).into(imageView) // rebind triggers second begin() while first still RUNNING
}

// after
private val target by lazy { Glide.with(itemView).asDrawable().load(placeholder).into(imageView) }
fun bind(url: String) {
  Glide.with(itemView).clear(imageView) // clear previous request first
  Glide.with(itemView).load(url).into(imageView)
}
Defensive patterns

Strategy: validation

Validate before calling

// Prefer letting Glide own the request via into(ImageView); it clears the previous one.
// If you hold a Request reference:
if (request.isRunning) {
  glide.with(view).clear(target)
}
request.begin()

Prevention

When it happens

Trigger: Calling request.begin() manually twice; calling into() twice on the same Target without a clear() between them while the first load is still active; calling Glide.with(...).load(...).into(sameView) rapidly (e.g. in a scrolling binder) before the first load resolves.

Common situations: RecyclerView adapters that rebind the same ViewHolder and re-trigger Glide.into() without first calling Glide.with(view).clear(target); Pagination/refresh logic that restarts a request on the same Target; custom Targets that call request.begin() in a callback.

Related errors


AI-assisted analysis of bumptech/glide@eb14a895d8 (2026-08-14). Data as JSON: /api/errors/13eae118981b52ca. Report an issue: GitHub.