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

Use proper resource identifers for table validation and dump state structs #2550

Closed
jphickey opened this issue Apr 18, 2024 · 0 comments · Fixed by #2551
Closed

Use proper resource identifers for table validation and dump state structs #2550

jphickey opened this issue Apr 18, 2024 · 0 comments · Fixed by #2551
Assignees

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Internally, table services keeps the state of a validation request and dump request in a separate structure under its global data. This is then referenced by index from the other areas (such as registry, etc).

This presents a possible race condition/stale data problem when indices are reused (they are treated as a ring buffer). That is, a reference to index "0" cannot be distinguished from a currently-valid index 0 or a previous reference that has since been closed and reopened for a different purpose.

Describe the solution you'd like
Use Resource IDs. These have two major benefits to the robustness of the code:

  • by assigning a different value each time an entry is re-used
  • simplifying init and check procedures by using "0" as a the undefined/reserved value (thus memset to 0 sets it to a safe state automatically).

Describe alternatives you've considered
N/A

Additional context
Gradually all table services indices should be converted to use resource IDs. However, changing the table handle will change the API, so that isn't being proposed yet.

These two items (validation and dump state) are rather simple and low-risk to change, as they aren't referenced in nearly as many places as the registry or handle/access descriptor table.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Apr 18, 2024
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the validation result
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the dump control
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the validation result
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the dump control
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the validation result
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the dump control
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the validation result
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the dump control
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the validation result
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2024
Use a resourceID value for access into the dump control
structure array.  This allows for consistent lookup, matching,
and free/in-use determination, as well as improved resilience
to race conditions and stale data.
dzbaker added a commit that referenced this issue May 2, 2024
Fix #2550, use resourceids for internal table validation and dump control blocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant