Skip to content
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

Fix #139, Do file writes in background #1148

Merged

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Feb 1, 2021

Describe the contribution
Implement a generic FS facility to perform file writes as a background job.

Applications wanting to use this facility need to instantiate a state object (metadata) in global memory, and two callback APIs- one to get a data record, another to send events.

The following file requests are changed to use this facility:

  • ES ER Log dump
  • SB Pipe Info
  • SB Message Map
  • SB Route Info
  • TBL Registry Dump

Fixes #139

Testing performed
First built and ran "main" branch (unchanged) and issued all file write commands before change to get a baseline/reference copy.
Then re-built with this change applied and re-issued all file write commands.
Compared old files to new files - confirmed that the new files are correct (but see note below!).

Expected behavior changes
Files are written in the context of the ES background task.

System(s) tested on
Ubuntu 20.04

Additional context
While examining the diffs between the old files and new files, I noticed that the queue depth in the Pipe Info was actually wrong in the original/reference data. This was due to some mismatches between Pipe Info fields where names were getting crossed.

In order to fix this and avoid it from happening in the future - this changes the internal SB member names to be consistently named:

  • MaxQueueDepth for maximum depth at queue creation time (previously was QueueDepth or Depth depending on context)
  • CurrentQueueDepth for the running count (previously was InUse or CurrentDepth depending on context)
  • PeakQueueDepth for the highest watermark (previously was PeakInUse or PeakDepth depending on context)

In particular the Depth and CurrentDepth were not (previously) being propagated to the file correctly - as the names got crossed in the implementation. This PR fixes it by making the names consistent.

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

@jphickey
Copy link
Contributor Author

jphickey commented Feb 1, 2021

This needs a rebase after next baseline - change is currently in commit c6d9f27. Pushing as draft to get review started.

@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Feb 1, 2021
@astrogeco astrogeco added CCB:2021-02-02 and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Feb 3, 2021
@astrogeco
Copy link
Contributor

astrogeco commented Feb 3, 2021

CCB:2021-02-03 APPROVED

  • Add new issue to account for naming convention discrepancies

@astrogeco
Copy link
Contributor

@jphickey is this ready?

Implements a generic asynchronous "file write request" facility
in the FS subsystem.  Given a metadata/control block with the file
details and writer state and appropriate callbacks,, this will
execute the file write job as part of the ES background task.

The following file requests are changed to use this facility:
- ES ER Log dump
- SB Pipe Info
- SB Message Map
- SB Route Info
- TBL Registry Dump
@jphickey jphickey marked this pull request as ready for review February 16, 2021 20:04
@jphickey
Copy link
Contributor Author

Rebased to "main" - ready to merge now.

@astrogeco astrogeco changed the base branch from main to integration-candidate February 17, 2021 15:21
@astrogeco astrogeco merged commit 37df32d into nasa:integration-candidate Feb 17, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Feb 17, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Feb 26, 2021
@jphickey jphickey deleted the fix-139-filewrite-background branch March 10, 2021 14:43
@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
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.

TBL - Dump Table Registry Data Command Can Hog CPU (GSFC DCR 23031)
3 participants