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 #373: Correct mutex around log file write #376

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

jphickey
Copy link
Contributor

The mutex for the log file write during the WriteLogFileCmd
excution was held longer than it should have been.

This lock must NOT be held during EVS_SendEvent, as this
will cause deadlock.

This moves the mutex to protect only the area that actually
accesses the log data, and it moves all send event calls
to be AFTER the mutex is released.

Testing performed
Built all code using default config and start CFE
Externally issue the WriteLogDataFile command with a valid output file

  • Confirmed that the log data file is generated successfully
    Externally issued the WriteLogDataFile command with a invalid output file (where OS_creat fails)
  • Confirmed that the expected error event is generated with no deadlock or issues

Expected behavior changes
No longer deadlocks in the case of an error during the file operations

System(s) tested on:
Ubuntu 18.04.2 LTS 64-bit

Contributor Info
Joseph Hickey, Vantage Systems, Inc.

The mutex for the log file write during the WriteLogFileCmd
excution was held longer than it should have been.

This lock must *NOT* be held during EVS_SendEvent, as this
will cause deadlock.

This moves the mutex to protect only the area that actually
accesses the log data, and it moves all send event calls
to be AFTER the mutex is released.
@jphickey jphickey requested a review from skliper October 12, 2019 01:14
@skliper skliper added this to the 6.8.0 milestone Oct 13, 2019
@stashakk
Copy link

MSFC approved

@CDKnightNASA
Copy link
Contributor

ARC approved

@skliper skliper added the bug label Oct 23, 2019
@skliper
Copy link
Contributor

skliper commented Oct 23, 2019

CCB 20191023 - approved

@skliper skliper added CCB:Approved Indicates code review and approval by community CCB and removed bug labels Oct 23, 2019
@skliper
Copy link
Contributor

skliper commented Oct 30, 2019

Fixes #373

skliper added a commit that referenced this pull request Oct 31, 2019
Fixes #361, #373, #374, #381
Code reviewed and approved at 20191023 and 30 CCBs
@skliper skliper changed the base branch from master to ic-20191030 November 7, 2019 21:33
@skliper skliper merged commit e9f7382 into nasa:ic-20191030 Nov 7, 2019
@jphickey jphickey deleted the fix-373-writelogfile-lock branch October 14, 2020 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants