destroy-environment: Too many files to remove

Bug #1177835 reported by Sidnei da Silva
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
John A Meinel

Bug Description

Trying to move from pyjuju to gojuju, reusing the same environment name and bucket names:

$ juju destroy-environment
error: Too many files to remove: 382

Related branches

Revision history for this message
Sidnei da Silva (sidnei) wrote :

Apparently it's the control-bucket that's contains those files.

Revision history for this message
John A Meinel (jameinel) wrote :

This is part of the openstack code:
func (s *storage) deleteAll() error {
        names, err := s.List("")
        if err != nil {
                return err
        }
        // Remove all the objects in parallel so that we incur less round-trips.
        // If we're in danger of having hundreds of objects,
        // we'll want to change this to limit the number
        // of concurrent operations.
        if len(names) > 100 {
                return fmt.Errorf("Too many files to remove: %d", len(names))
        }
        var wg sync.WaitGroup
        wg.Add(len(names))
        errc := make(chan error, len(names))
        for _, name := range names {

Revision history for this message
John A Meinel (jameinel) wrote :

Basically, Openstack doesn't have a delete many request, so we have to request them one-by-one. We limited it to 100 because we didn't want to have an unbounded number of goroutines (they are cheap, but how cheap?).

Since we are hitting this in practice, we should switch out the logic for a worker based one. (Spawn up to N workers, all working on a queue of M items to remove.)

Changed in juju-core:
importance: Undecided → High
status: New → Confirmed
William Reade (fwereade)
Changed in juju-core:
status: Confirmed → Fix Committed
milestone: none → 1.11.1
Martin Packman (gz)
Changed in juju-core:
assignee: nobody → Martin Packman (gz)
assignee: Martin Packman (gz) → John A Meinel (jameinel)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.