@@ -32,6 +32,9 @@ import (
3232
3333type Bridge struct {
3434 mu sync.Mutex
35+ pendingMu sync.Mutex
36+ pending map [sequenceID ]* prot.ContainerExecuteProcessResponse
37+
3538 hostState * Host
3639 // List of handlers for handling different rpc message requests.
3740 rpcHandlerList map [prot.RPCProc ]HandlerFunc
@@ -77,6 +80,7 @@ type request struct {
7780func NewBridge (shimConn io.ReadWriteCloser , inboxGCSConn io.ReadWriteCloser , initialEnforcer securitypolicy.SecurityPolicyEnforcer ) * Bridge {
7881 hostState := NewHost (initialEnforcer )
7982 return & Bridge {
83+ pending : make (map [sequenceID ]* prot.ContainerExecuteProcessResponse ),
8084 rpcHandlerList : make (map [prot.RPCProc ]HandlerFunc ),
8185 hostState : hostState ,
8286 shimConn : shimConn ,
@@ -378,6 +382,23 @@ func (b *Bridge) ListenAndServeShimRequests() error {
378382 logrus .Error (recverr )
379383 break
380384 }
385+ // If this is a ContainerExecuteProcessResponse, notify
386+ const MsgExecuteProcessResponse prot.MsgType = prot .MsgTypeResponse | prot .MsgType (prot .RPCExecuteProcess )
387+
388+ if header .Type == MsgExecuteProcessResponse {
389+ logrus .Tracef ("Printing after inbox exec resp" )
390+ var procResp prot.ContainerExecuteProcessResponse
391+ if err := json .Unmarshal (message , & procResp ); err != nil {
392+ logrus .Tracef ("unmarshal failed" )
393+ }
394+
395+ b .pendingMu .Lock ()
396+ if _ , exists := b .pending [header .ID ]; exists {
397+ logrus .Tracef ("Header ID in pending exists" )
398+ b .pending [header .ID ] = & procResp
399+ }
400+ b .pendingMu .Unlock ()
401+ }
381402
382403 // Forward to shim
383404 resp := bridgeResponse {
0 commit comments