Skip to content

goroutine leak issue #57

@rhinoxi

Description

@rhinoxi

Hi, I'm facing one goroutine leak issue when uploading.

// Waits for a signal to broadcast to all subscribers
func (u *Uploader) broadcastProgress() {
	for _ = range u.notifyChan {
		for _, c := range u.uploadSubs {
			c <- *u.upload
		}
	}
}

// NewUploader creates a new Uploader.
func NewUploader(client *Client, url string, upload *Upload, offset int64) *Uploader {
	notifyChan := make(chan bool)

	uploader := &Uploader{
		client,
		url,
		upload,
		offset,
		false,
		nil,
		notifyChan,
	}

	go uploader.broadcastProgress()

	return uploader
}

the notifyChan will not be closed in any case, so the broadcastProgress goroutine is hanging, also mentioned here #55.

can anyone look into this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions