|
|
| F´ Version |
v3.6.4 |
| Affected Component |
Svc.FileDownlink |
Problem Description
A buffer ownership bug was fixed in v4.2.0, see #4555. It would be nice to backport this fix to v3.6.x.
This bug was found by implementing and placing a ThrottledBufferRepeater downstream of a FileDownlink component, and setting the throttle timing high enough that it triggered a FileDownlink timeout. This brought to light a bug in bufferReturn_handler(), where FileDownlink doesn't properly handle receiving buffers while in COOLDOWN mode.
The fix in #4555 should keep us from hitting the COOLDOWN bug in normal conditions, since FileDownlink won't enter COOLDOWN mode until the buffer has been returned. However, I would also like to update bufferReturn_handler() so it knows how to handle returned buffers while in COOLDOWN mode. Here's how bufferReturn_handler() currently handles returned buffers based on the component's mode:
IDLE: Does nothing
CANCEL: Sends appropriate next packet
WAIT: Sends appropriate next packet
DOWNLINK: asserts, but this is okay since the DOWNLINK mode is a temporary mode only used while inside of a bufferReturn_handler() call, so we should never be in DOWNLINK mode at the start of a bufferReturn_handler() call
COOLDOWN: asserts, not ideal! But would require the downstream component to return a packet at an unexpected time.
I think returned buffers should be handled the same way in both IDLE mode and COOLDOWN mode. Seeing as how bufferReturn_handler() already has a non-asserting offramp for buffers returned during IDLE mode, I propose we do the same for COOLDOWN mode. I believe this COOLDOWN fix would also be useful for F Prime v4... if there is any concurrence I can open an issue and PR to pull that change into dev.
I will open a PR shortly with the #4555 fix cherry-picked on top of v3.6.4, along with a fix so bufferReturn_handler() handles COOLDOWN mode.
How to Reproduce
- Place a component downstream of
FileDownlink that takes longer than FileDownlink's m_timeout, but shorter than m_timeout + m_cooldown, to return.
- Once the timeout occurs,
FileDownlink will assert in bufferReturn_handler() when it receives the returned buffer while in COOLDOWN mode.
Expected Behavior
FileDownlink should not assert when it receives a returned buffer while in COOLDOWN mode.
v3.6.4Svc.FileDownlinkProblem Description
A buffer ownership bug was fixed in
v4.2.0, see #4555. It would be nice to backport this fix tov3.6.x.This bug was found by implementing and placing a
ThrottledBufferRepeaterdownstream of aFileDownlinkcomponent, and setting the throttle timing high enough that it triggered aFileDownlinktimeout. This brought to light a bug inbufferReturn_handler(), whereFileDownlinkdoesn't properly handle receiving buffers while inCOOLDOWNmode.The fix in #4555 should keep us from hitting the
COOLDOWNbug in normal conditions, sinceFileDownlinkwon't enterCOOLDOWNmode until the buffer has been returned. However, I would also like to updatebufferReturn_handler()so it knows how to handle returned buffers while inCOOLDOWNmode. Here's howbufferReturn_handler()currently handles returned buffers based on the component's mode:IDLE: Does nothingCANCEL: Sends appropriate next packetWAIT: Sends appropriate next packetDOWNLINK: asserts, but this is okay since theDOWNLINKmode is a temporary mode only used while inside of abufferReturn_handler()call, so we should never be inDOWNLINKmode at the start of abufferReturn_handler()callCOOLDOWN: asserts, not ideal! But would require the downstream component to return a packet at an unexpected time.I think returned buffers should be handled the same way in both
IDLEmode andCOOLDOWNmode. Seeing as howbufferReturn_handler()already has a non-asserting offramp for buffers returned duringIDLEmode, I propose we do the same forCOOLDOWNmode. I believe thisCOOLDOWNfix would also be useful for F Primev4... if there is any concurrence I can open an issue and PR to pull that change intodev.I will open a PR shortly with the #4555 fix cherry-picked on top of v3.6.4, along with a fix so
bufferReturn_handler()handlesCOOLDOWNmode.How to Reproduce
FileDownlinkthat takes longer thanFileDownlink'sm_timeout, but shorter thanm_timeout + m_cooldown, to return.FileDownlinkwill assert inbufferReturn_handler()when it receives the returned buffer while inCOOLDOWNmode.Expected Behavior
FileDownlinkshould not assert when it receives a returned buffer while inCOOLDOWNmode.