-
Notifications
You must be signed in to change notification settings - Fork 2
refactor fileio [CPP-472] #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
console_backend/src/fileio.rs
Outdated
| let chunk_size = match chunk_sizes.lock().remove(&msg.sequence) { | ||
| Some(chunk_size) => chunk_size, | ||
| None => { | ||
| error!("unexpected message {:?}", msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to think of scenarios where this may happen. If someone were to shoot off an upgrade process then additionally try to send a file to the device with the bin possibly? If the result was benign maybe debug would make more sense here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's sort of the scenario I was thinking of. Should be harmless if it happens so I'll downgrade it to a debug
| .expect(THREAD_START_FAILURE); | ||
| scope | ||
| .builder() | ||
| .name("request-maker".into()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great addition we should probably implement this throughout the app as well if we continue seeing reliability issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it makes using gdb a bit easier. You can also set the stack size for the thread. The default is 2mb, we could probably shave a bit of memory usage off too by going thru and trying smaller sizes.
With a 1mb file, before:
After:
I think the original was so slow because by not using the
window_sizewe'd send writes for parts of the file that are really far apart causing a lot of seeking back and forth on the piksi's end, but not 100% sure.