-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A lot of files in /var/lib/bblfshd/tmp/
#168
Comments
As @dennwc said in Slack, these files (grpc sockets) should probably be created on /tmp since there is no need to persist them. |
On the other hand, why would we have 57976 grpc sockets without cleanup? Aren't these removed when they are closed? |
I think last time I checked they should, but I'm not 100% sure, also I don't know if when bblfshd/libcontainer restarts or kill a container it has any chance to clean up stuff. |
Closing a Unix-domain socket does not necessarily remove it, cf. https://gist.github.com/creachadair/214e46db4a0b891d3e9b52ff8bd861d5 Also, regarding |
@EgorBu can you confirm that this is still happening? I remember doing some changes about how sockets where closed some time ago and my |
I can reproduce this with
Note that doing Code: package main
import (
"fmt"
"runtime"
"sync"
"sync/atomic"
bblfsh "gopkg.in/bblfsh/client-go.v2"
)
func main() {
client, err := bblfsh.NewClient("0.0.0.0:9432")
if err != nil {
panic(err)
}
wg := sync.WaitGroup{}
var count int32
for i := 0; i < runtime.NumCPU(); i++ {
wg.Add(1)
go func() {
for {
code := `package main`
_, _, err = client.
NewParseRequest().
Language("go").
Content(code).
UAST()
if err != nil {
panic(err)
}
newCount := atomic.AddInt32(&count, 1)
if newCount%100 == 0 {
fmt.Printf("Requests: %d\n", newCount)
}
}
wg.Done()
}()
}
wg.Wait()
} |
You can reproduce with N > NumCPU too, I think it just reduces the driver instance churn rate a little bit. |
Thanks @smola, this will be very useful. |
Hi,
I noticed that the directory
/var/lib/bblfshd/tmp/
has too many files:Do you know how it is caused? Should it be removed automatically?
The text was updated successfully, but these errors were encountered: