Skip to content

Commit cbb7352

Browse files
authored
Merge pull request #215 from pwrdrvr/issue-2/log-endpoint-on-connect-failure
Issue 2 - Log Endpoint on Connect Failure
2 parents 54750fd + cfbd559 commit cbb7352

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: extension/src/lambda_request.rs

+11
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ impl LambdaRequest {
107107
// Startup the request channels
108108
let channel_futures = (0..self.channel_count)
109109
.map(|channel_number| {
110+
let router_endpoint_url = self.router_endpoint.url().clone();
111+
let lambda_id = Arc::clone(&self.lambda_id);
110112
let last_active = Arc::clone(&self.last_active);
111113
// Create a JoinHandle and implicitly return it to be collected in the vector
112114
let mut router_channel = RouterChannel::new(
@@ -133,6 +135,15 @@ impl LambdaRequest {
133135
.start(app_client.clone(), router_client.clone())
134136
.await;
135137

138+
// If we failed to connect to the router we should log our IP, router IP, port and protocol
139+
if let Err(LambdaRequestError::RouterUnreachable) = result {
140+
log::error!(
141+
"LambdaId: {} - start - Failed to connect to router: {}",
142+
lambda_id,
143+
router_endpoint_url
144+
);
145+
}
146+
136147
// Tell the other channels to stop
137148
goaway_received.store(true, Ordering::Release);
138149

0 commit comments

Comments
 (0)