-
Notifications
You must be signed in to change notification settings - Fork 111
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
Module fixes for Windows #1816
Module fixes for Windows #1816
Conversation
if m.parent != nil { | ||
if err := m.parent.Close(ctx); err != nil { | ||
m.closeOnce.Do(func() { | ||
m.mu.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in windows we were shutting this process down too quickly because of how process groping and CtrlC works there (changed that in goutils now so this doesn't get hit). this makes sure we don't hold the lock and cause a race where RemoveResource is happening while Closing (happened a lot in Windows)
@@ -379,6 +385,12 @@ func (m *Module) ReconfigureResource(ctx context.Context, req *pb.ReconfigureRes | |||
|
|||
// RemoveResource receives the request for resource removal. | |||
func (m *Module) RemoveResource(ctx context.Context, req *pb.RemoveResourceRequest) (*pb.RemoveResourceResponse, error) { | |||
slowWatcher, slowWatcherCancel := utils.SlowGoroutineWatcher( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will dump stacks after 30 seconds if this function doesn't end by then
@@ -154,10 +154,15 @@ func (s *robotServer) runServer(ctx context.Context) error { | |||
} | |||
cancel() | |||
|
|||
slowWatcher, slowWatcherCancel := utils.SlowGoroutineWatcherAfterContext( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will dump stacks after 90 seconds if this function doesn't end by then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM... slowWatcher stuff is a nice addition, as we "should" never hit it, but great debugging help when it happens.
@@ -260,7 +260,7 @@ func (m *module) checkReady(ctx context.Context, parentAddr string) error { | |||
} | |||
|
|||
func (m *module) startProcess(ctx context.Context, parentAddr string, logger golog.Logger) error { | |||
m.addr = filepath.Dir(parentAddr) + "/" + m.name + ".sock" | |||
m.addr = filepath.ToSlash(filepath.Join(filepath.Dir(parentAddr), m.name+".sock")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should've done that in the first place... I literally had the thought, then "no, we don't support windows anyway, so a simple slash literal is more readable"
|
This also adds a neat little stack dumper when things fail to close in time