Skip to content

Change File info poller to respond when capacity in channel opens up and decode stream into Vec of structs - #715

Merged
bbalser merged 9 commits into
mainfrom
bbalser/file-info-poller-updates
Jan 23, 2024
Merged

bbalser merged 9 commits into
mainfrom
bbalser/file-info-poller-updates

Conversation

@bbalser

@bbalser bbalser commented Jan 19, 2024 •

Copy link
Copy Markdown
Collaborator

This is an attempt to make the file_info_poller more responsive to capacity in the mpsc::channel. It should help consumers not have any delays in processing data when they are backed up.

Also the file_info_poller now converted the stream of bytes into a Vec of the decoded struct. Not sure this is a great idea, but we have seen that holding the stream open to AWS while in the channel waiting for the consumer to process the file can cause "connection reset by peer" errors when the consumer takes a while processing the stream or is really backed up. This change will cause the use of more memory but should allow the consumer to process data faster.

@bbalser
bbalser force-pushed the bbalser/file-info-poller-updates branch from b5fde69 to 69d38a2 Compare January 22, 2024 13:58
@bbalser
bbalser marked this pull request as ready for review January 22, 2024 14:28
}
}
_ = cleanup_trigger.tick() => self.clean(&self.cache).await?,
result = futures::future::try_join(sender.reserve().map_err(Error::from), self.get_next_file()) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like it's safe to assume that the joined result tuple is treated like collecting an iterator of results into a single result wrapping a collection, i.e. assuming both operations being joined are Ok(_) the result tuple will be Ok(result_1_inner, result_2_inner)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@bbalser
bbalser merged commit 0e603e0 into main Jan 23, 2024
@bbalser
bbalser deleted the bbalser/file-info-poller-updates branch January 23, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants