From: Skip Tavakkolian <skip.tavakkolian@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] Go testing and resource exhaustion
Date: Fri, 24 May 2013 14:57:56 -0700 [thread overview]
Message-ID: <CAJSxfm+yLz9tkmQCdVDNDiU01NdjyMucTtSoASps7pmh03kNiQ@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1991 bytes --]
This is just an FYI.
I'm seeing something that looks to me like a resource exhaustion of some
sort. When running the standard test (i.e. go test std), some tests are
broken (see below); but test of each "broken" package/cmd/etc, passes
correctly.
I thought it might be related to semaphores, but the attached program
didn't fail at all; in fact running 100 simultaneously caused nothing more
than several temporary "Fault" states, but none broken.
partial output of ps:
fst 83379 0:00 0:00 240K Await run.rc -e ./run.rc
--no-rebuild
fst 83385 0:00 0:00 48K Await time go test std
-short -timeout 120s
fst 83386 0:04 0:07 797488K Semacqui go test std -short
-timeout 120s
fst 83387 0:00 0:00 797488K Semacqui go
fst 83388 0:00 0:00 797488K Tsemacqu go
fst 83389 0:00 0:00 797488K Semacqui go
fst 83399 0:00 0:00 797488K Pread go
fst 83401 0:00 0:00 797488K Pread go
fst 83403 0:00 0:01 797488K Semacqui go
fst 83404 0:00 0:00 797488K Pread go
fst 83405 0:00 0:00 797488K Semacqui go
fst 83406 0:00 0:01 797488K Pread go
fst 83407 0:00 0:00 797488K Semacqui go
fst 83426 0:00 0:00 797488K Semacqui go
fst 83437 0:00 0:00 794320K Sleep api.test
fst 83453 0:00 0:00 794528K Broken tar.test
fst 83497 0:00 0:00 793628K Sleep bzip2.test
fst 83499 0:00 0:00 793628K Broken bzip2.test
fst 83532 0:00 0:00 794328K Sleep lzw.test
fst 83533 0:00 0:00 794328K Broken lzw.test
fst 84100 0:00 0:00 795204K Sleep template.test
fst 84101 0:00 0:00 795204K Semacqui template.test
fst 84102 0:00 0:00 795204K Broken template.test
[-- Attachment #1.2: Type: text/html, Size: 2405 bytes --]
[-- Attachment #2: goroutines.go --]
[-- Type: application/octet-stream, Size: 530 bytes --]
package main
import (
"fmt"
"math/rand"
)
func produce(ch chan<- int, n int) {
for i := 0; i < n; i++ {
ch <- i
}
}
func consume(ch <-chan int) {
for i := range ch {
if i % 100 == 0 {
fmt.Println(i)
}
}
}
func busywork(n int, done chan<- bool) {
ch := make(chan int)
go produce(ch, n)
consume(ch)
done <- true
}
const N = 1000
func main() {
r := rand.New(rand.NewSource(1000000))
done := make(chan bool)
for i := 0; i < N; i++ {
go busywork(r.Int(), done)
}
for i := 0; i < N; i++ {
<-done
}
}
next reply other threads:[~2013-05-24 21:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-24 21:57 Skip Tavakkolian [this message]
2013-05-25 5:14 ` lucio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJSxfm+yLz9tkmQCdVDNDiU01NdjyMucTtSoASps7pmh03kNiQ@mail.gmail.com \
--to=skip.tavakkolian@gmail.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).