@@ -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 ,
@@ -375,6 +379,23 @@ func (b *Bridge) ListenAndServeShimRequests() error {
375379 logrus .Error (recverr )
376380 break
377381 }
382+ // If this is a ContainerExecuteProcessResponse, notify
383+ const MsgExecuteProcessResponse prot.MsgType = prot .MsgTypeResponse | prot .MsgType (prot .RPCExecuteProcess )
384+
385+ if header .Type == MsgExecuteProcessResponse {
386+ logrus .Tracef ("Printing after inbox exec resp" )
387+ var procResp prot.ContainerExecuteProcessResponse
388+ if err := json .Unmarshal (message , & procResp ); err != nil {
389+ logrus .Tracef ("unmarshal failed" )
390+ }
391+
392+ b .pendingMu .Lock ()
393+ if _ , exists := b .pending [header .ID ]; exists {
394+ logrus .Tracef ("Header ID in pending exists" )
395+ b .pending [header .ID ] = & procResp
396+ }
397+ b .pendingMu .Unlock ()
398+ }
378399
379400 // Forward to shim
380401 resp := bridgeResponse {
0 commit comments