Skip to content

Commit

Permalink
Merge branch 'master' into yophilav/updateBaseImgScript_master
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Apr 12, 2021
2 parents bdaffc4 + 1a2c97c commit 78738bd
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 178 deletions.
14 changes: 11 additions & 3 deletions mqtt/mqtt-bridge/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,17 @@ where
if let Some(publication) = forward_publication {
debug!("saving message to store");
return match self.store.push(&publication) {
Ok(_) |
// If we are full we are dropping the message on ground.
Err(PersistError::RingBuffer(RingBufferError::Full)) => Ok(Handled::Fully),
Ok(_) => Ok(Handled::Fully),
Err(
err
@
PersistError::RingBuffer(RingBufferError::InsufficientSpace {
..
}),
) => {
error!(error = %err, "dropping incoming publication");
Ok(Handled::Fully)
}
Err(err) => Err(BridgeError::Store(err)),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub enum RingBufferError {
#[error("Flushing failed. Caused by {0}")]
Flush(std::io::Error),

#[error("Buffer is full and messages must be drained to continue")]
Full,
#[error("Storage has insufficient space to insert data: required: {required}b, but only {free}b available")]
InsufficientSpace { free: u64, required: u64 },

#[error("Unable to create file. Caused by {0}")]
FileCreate(std::io::Error),
Expand Down
Loading

0 comments on commit 78738bd

Please sign in to comment.