mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
update docs with pro tips for fdk http stream people (#1211)
* update docs with pro tips for fdk http stream people * fix bug where container could die before uds wait we used to hang out for an hour. oopsie, thanks Owen
This commit is contained in:
@@ -925,19 +925,6 @@ func (a *agent) runHot(ctx context.Context, call *call, tok ResourceToken, state
|
||||
return
|
||||
}
|
||||
|
||||
// now we wait for the socket to be created before handing out any slots
|
||||
select {
|
||||
case err := <-udsAwait: // XXX(reed): need to leave a note about pairing ctx here?
|
||||
// sends a nil error if all is good, we can proceed...
|
||||
if err != nil {
|
||||
call.slots.queueSlot(&hotSlot{done: make(chan struct{}), fatalErr: err})
|
||||
return
|
||||
}
|
||||
case <-ctx.Done():
|
||||
call.slots.queueSlot(&hotSlot{done: make(chan struct{}), fatalErr: ctx.Err()})
|
||||
return
|
||||
}
|
||||
|
||||
// container is running
|
||||
state.UpdateState(ctx, ContainerStateIdle, call.slots)
|
||||
|
||||
@@ -949,6 +936,20 @@ func (a *agent) runHot(ctx context.Context, call *call, tok ResourceToken, state
|
||||
go func() {
|
||||
defer shutdownContainer() // also close if we get an agent shutdown / idle timeout
|
||||
|
||||
// now we wait for the socket to be created before handing out any slots, need this
|
||||
// here in case the container dies before making the sock we need to bail
|
||||
select {
|
||||
case err := <-udsAwait: // XXX(reed): need to leave a note about pairing ctx here?
|
||||
// sends a nil error if all is good, we can proceed...
|
||||
if err != nil {
|
||||
call.slots.queueSlot(&hotSlot{done: make(chan struct{}), fatalErr: err})
|
||||
return
|
||||
}
|
||||
case <-ctx.Done():
|
||||
call.slots.queueSlot(&hotSlot{done: make(chan struct{}), fatalErr: ctx.Err()})
|
||||
return
|
||||
}
|
||||
|
||||
for {
|
||||
select { // make sure everything is up before trying to send slot
|
||||
case <-ctx.Done(): // container shutdown
|
||||
|
||||
Reference in New Issue
Block a user