Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rpc/wrtc_call_queue_mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ func (queue *mongoDBWebRTCCallQueue) checkHostQueueSize(ctx context.Context, for
return errTooManyConns
}

var errOffline = status.Error(codes.Unavailable, "host appears to be offline; ensure machine is online and try again")
var ErrOffline = errors.New("host appears to be offline; ensure machine is online and try again")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the "unavailable" status?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see the comment from your other PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated it to just check for ErrOffline by making ErrOffline a regular error instead of a status. I think making it status() was double wrapping it down the line because the original error was rpc error: code = Unavailable desc = requestID=99cc1420b3f4e658458dc61ec70cb033: rpc error: code = Unavailable desc = host appears to be offline; ensure machine is online and try again; context deadline exceeded; mDNS query failed to find a candidate

pasting it here so its easier for others to see^!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the error become with this change? you can test this by pointing goutils on app to this change and running the cli/sdk against it. I ask because I would like to keep the Unavailable code if possible, so if we lose that we should think of ways to keep it in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reverting this change because the new error status has the error as "unknown" vs "unavailable". So something else is re-wrapping this error status but without the "unavailable" status wanted. I think you can get the error message from the status by converting it later on anyways


// checkHostOnline will check if there is some operator for all the managed hosts that
// claims to have an answerer online for that host. It does this by running an aggregation
Expand Down Expand Up @@ -1128,7 +1128,7 @@ func (queue *mongoDBWebRTCCallQueue) checkHostOnline(ctx context.Context, hosts
return err
}
if len(ret) == 0 {
return errOffline
return ErrOffline
}
return nil
}
Expand All @@ -1149,7 +1149,7 @@ func (queue *mongoDBWebRTCCallQueue) incrementConnectionEstablishmentExpectedFai
// error (internal error from MDB query, e.g.). We can tell from the passed in error.

reason := "other"
if errors.Is(err, errOffline) {
if errors.Is(err, ErrOffline) {
reason = "answerers_offline"
} else if errors.Is(err, errTooManyConns) {
reason = "too_many_callers"
Expand Down
4 changes: 2 additions & 2 deletions rpc/wrtc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func dialWebRTC(

utils.PanicCapturingGo(func() {
if err := exchangeCandidates(); err != nil {
logger.Warnw("Failed to exchange candidates", "err", err)
logger.Debugw("Failed to exchange candidates", "err", err)
exchangeCancel(err)
}
})
Expand All @@ -411,7 +411,7 @@ func dialWebRTC(
Error: ErrorToStatus(exchangeErr).Proto(),
},
}); err != nil {
logger.Warnw("Problem sending error to signaling server", "err", err)
logger.Debugw("Problem sending error to signaling server", "err", err)
}
})
return nil, exchangeErr
Expand Down
Loading