mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
fix service/sending events
This commit is contained in:
parent
60b89aba78
commit
e7087444db
1 changed files with 11 additions and 9 deletions
|
|
@ -190,8 +190,10 @@ impl Service {
|
||||||
|
|
||||||
if entry.len() > 30 {
|
if entry.len() > 30 {
|
||||||
warn!(
|
warn!(
|
||||||
"Dropping some current events: {:?} {:?} {:?}",
|
?key,
|
||||||
key, destination, event
|
?destination,
|
||||||
|
?event,
|
||||||
|
"Dropping some current events",
|
||||||
);
|
);
|
||||||
self.db.delete_active_request(key)?;
|
self.db.delete_active_request(key)?;
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -324,7 +326,7 @@ impl Service {
|
||||||
current_transaction_status,
|
current_transaction_status,
|
||||||
) {
|
) {
|
||||||
Ok(SelectedEvents::Retries(events)) => {
|
Ok(SelectedEvents::Retries(events)) => {
|
||||||
debug!("retrying old events");
|
debug!("Retrying old events");
|
||||||
Some(HandlerInputs {
|
Some(HandlerInputs {
|
||||||
destination,
|
destination,
|
||||||
events,
|
events,
|
||||||
|
|
@ -332,7 +334,7 @@ impl Service {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Ok(SelectedEvents::New(events)) => {
|
Ok(SelectedEvents::New(events)) => {
|
||||||
debug!("sending new event");
|
debug!("Sending new event");
|
||||||
Some(HandlerInputs {
|
Some(HandlerInputs {
|
||||||
destination,
|
destination,
|
||||||
events,
|
events,
|
||||||
|
|
@ -340,7 +342,7 @@ impl Service {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Ok(SelectedEvents::None) => {
|
Ok(SelectedEvents::None) => {
|
||||||
debug!("holding off from sending any events");
|
debug!("Holding off from sending any events");
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
|
@ -678,7 +680,7 @@ impl Service {
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
warn!("Timeout waiting for server response of {destination}");
|
warn!("Timeout waiting for server response");
|
||||||
Error::BadServerResponse("Timeout waiting for server response")
|
Error::BadServerResponse("Timeout waiting for server response")
|
||||||
})?;
|
})?;
|
||||||
drop(permit);
|
drop(permit);
|
||||||
|
|
@ -873,7 +875,7 @@ async fn handle_federation_event(
|
||||||
.timeline
|
.timeline
|
||||||
.get_pdu_json_from_id(pdu_id)?
|
.get_pdu_json_from_id(pdu_id)?
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
error!("event not found: {server} {pdu_id:?}");
|
error!(pdu_id = ?pdu_id, "PDU not found");
|
||||||
Error::bad_database(
|
Error::bad_database(
|
||||||
"[Normal] Event in servernamevent_datas not \
|
"[Normal] Event in servernamevent_datas not \
|
||||||
found in db.",
|
found in db.",
|
||||||
|
|
@ -915,8 +917,8 @@ async fn handle_federation_event(
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
for pdu in response.pdus {
|
for pdu in response.pdus {
|
||||||
if pdu.1.is_err() {
|
if let (event_id, Err(error)) = pdu {
|
||||||
warn!("Failed to send to {}: {:?}", server, pdu);
|
warn!(%server, %event_id, %error, "Failed to send event to server");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue