Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
17eb94d
RDKB-58634: Replace tr181 set with rbus set for rdm download request
nhanasi Feb 5, 2025
220c875
Update rrdMain.c
Abhinavpv28 Feb 6, 2025
c30db2c
RDK-56099: Pytest L2 Implementation Code Changes (#42)
nhanasi Feb 13, 2025
98891bf
RDKE-263:[OSCR Scan] RDKE - remote_debugger repo (#44)
nhanasi Feb 14, 2025
c2c0350
RDK-56099: Enable L2 test workflows with PR
Feb 17, 2025
d3a7b30
RDK-56099: Pre-clone dependent repositories
Feb 17, 2025
6c3fe08
Move native builds as optional
shibu-kv Feb 17, 2025
7503e4d
RDK-56099: Correct the report directory location
shibu-kv Feb 17, 2025
549b3a8
Update L2-tests.yml
nhanasi Feb 17, 2025
541e182
Update run_l2.sh
nhanasi Feb 17, 2025
1669771
Update test_rrd_debug_report_upload.py
nhanasi Feb 17, 2025
2d0db19
Create uploadSTBLogs.sh
nhanasi Feb 17, 2025
e9b2077
Update L2-tests.yml
nhanasi Feb 17, 2025
a5a342c
Update L2-tests.yml
nhanasi Feb 17, 2025
86bbba3
Merge pull request #49 from rdkcentral/feature/L2-Workflows
venkat0557 Feb 18, 2025
0c00ecb
Update rrdMain.c
Abhinavpv28 Feb 19, 2025
2a6d7a6
RDK-56099: Pytest L2 Implementation Code Changes
nhanasi Feb 19, 2025
cdf2e00
RDK-56099: Pytest L2 Implementation Code Changes
nhanasi Feb 19, 2025
a8f98aa
Merge branch 'feature/RDK-56099_add' of https://github.com/rdkcentral…
nhanasi Feb 19, 2025
5361f12
Merge pull request #53 from rdkcentral/feature/RDK-56099_add
venkat0557 Feb 19, 2025
842bf96
rebase (#54)
nhanasi Feb 20, 2025
32ee61f
Revert "rebase (#54)" (#55)
nhanasi Feb 20, 2025
663ab5b
RDK-56099: Pytest L2 Implementation Code Changes (#39)
nhanasi Feb 7, 2025
1ff6f6a
RDK-56099: Pytest L2 Implementation Code Changes (#42)
nhanasi Feb 13, 2025
8f8625f
RDKE-263:[OSCR Scan] RDKE - remote_debugger repo (#44)
nhanasi Feb 14, 2025
c20a51e
RDK-56099: Enable L2 test workflows with PR
Feb 17, 2025
205e931
RDK-56099: Pre-clone dependent repositories
Feb 17, 2025
59a26cf
Move native builds as optional
shibu-kv Feb 17, 2025
28cf657
RDK-56099: Correct the report directory location
shibu-kv Feb 17, 2025
c1d8164
Update L2-tests.yml
nhanasi Feb 17, 2025
74825e4
Update run_l2.sh
nhanasi Feb 17, 2025
6e78e09
Update test_rrd_debug_report_upload.py
nhanasi Feb 17, 2025
86c2eb7
Create uploadSTBLogs.sh
nhanasi Feb 17, 2025
4c1b744
Update L2-tests.yml
nhanasi Feb 17, 2025
dfcb4f4
Update L2-tests.yml
nhanasi Feb 17, 2025
a238290
RDK-56099: Pytest L2 Implementation Code Changes
nhanasi Feb 19, 2025
a00f032
RDK-56099: Pytest L2 Implementation Code Changes
nhanasi Feb 19, 2025
c7bd5d6
Update L1-Test.yml
nhanasi Feb 20, 2025
4e9a0c1
Create code-coverage.yml
nhanasi Feb 20, 2025
4252268
Update run_ut.sh
nhanasi Feb 20, 2025
7509469
Merge pull request #57 from rdkcentral/develop
nhanasi Feb 20, 2025
8d13d1e
Merge pull request #60 from rdkcentral/feature/RDKEMW-1768
nhanasi Feb 20, 2025
8c2ff11
Update rrdMain.h
Abhinavpv28 Feb 21, 2025
677349e
Merge pull request #64 from rdkcentral/develop
Abhinavpv28 Feb 21, 2025
d243035
Update cov_build.sh
Abhinavpv28 Feb 21, 2025
fd8bb69
Update cov_build.sh (#65)
nhanasi Feb 21, 2025
0f4b7d5
1.2.2 release changelog updates
nhanasi Feb 21, 2025
e1d7f00
Merge branch 'release/1.2.2' into main
nhanasi Feb 21, 2025
5cf549f
Merge tag '1.2.2' into develop
nhanasi Feb 21, 2025
6637ed6
Merge branch 'feature/RDKB-58634' into develop
nhanasi Feb 24, 2025
25f13a7
Revert "RDKB-58634: Replace tr181 set with rbus set for rdm download …
nhanasi Feb 24, 2025
39bbbad
Update rrdEventProcess.c
nhanasi Feb 20, 2025
c8f2cb5
Update rrdMain.c
nhanasi Feb 20, 2025
49e4327
DELIA-67277: Use the updated msg_unpack_next() for handling webconfig…
AravindanNC Feb 24, 2025
329851a
1.2.3 release changelog updates
naveenkumarhanasi Feb 25, 2025
6261ae0
1.2.3 release changelog updates
naveenkumarhanasi Feb 25, 2025
0e9d038
Merge pull request #80 from rdkcentral/release/1.2.3
nhanasi Feb 26, 2025
0e73ba7
Merge branch 'main' of https://github.com/rdkcentral/remote_debugger …
nhanasi Feb 26, 2025
f2d0f68
RDKB-58835 : [Productisation] Enable RRD Dynamic Profile for RDKB pl…
Abhinavpv28 Mar 6, 2025
d167642
1.2.4 release changelog updates
nhanasi Mar 6, 2025
1e714a4
Merge branch 'release/1.2.4' into main
nhanasi Mar 6, 2025
9c234d3
Merge tag '1.2.4' into develop
nhanasi Mar 6, 2025
28c68d3
RDKB-58835-[Productisation] Enable RRD Dynamic Profile for RDKB platf…
Abhinavpv28 Mar 7, 2025
33a1bc2
RDKECMF-219 Remove redundant variable
scthunderbolt Mar 13, 2025
463e41f
RDKECMF-219 Enable component build workflow on Pull Request
scthunderbolt Mar 13, 2025
011a362
Test component build workflow
scthunderbolt Mar 13, 2025
427ec0c
Merge pull request #96 from scthunderbolt/feature/test-workflows
scthunderbolt Mar 14, 2025
f1cca63
RDKEMW-1768 -Fix UT in RRD with Static profile update and Null Check …
Abhinavpv28 Mar 21, 2025
d95dbb0
RDK-55702: Update the MW clients to use Power Manager Plugin (#100)
santoshcomcast Mar 26, 2025
8c49b9c
1.2.5 release changelog updates
nhanasi Mar 26, 2025
273f585
Merge branch 'release/1.2.5' into main
naveenkumarhanasi Mar 27, 2025
5cfc4d5
Merge tag '1.2.5' into develop
naveenkumarhanasi Mar 27, 2025
63ac0f7
RDK-56451 [RDKE] Move tr69hostif L2 binary into common docker repo (#…
madhubabutt Mar 28, 2025
6edfc37
RDK-56115 : [RDKE] Fix coverity issues in RRD
Apr 1, 2025
29662b0
RDK-56115 : Fix for Uninitialised Variable
Apr 1, 2025
f9f44d0
Update rrdIarmEvents.c
Saranya2421 Apr 1, 2025
09006e0
RDk-56115 : Fix for L2 Test Failure
Apr 2, 2025
960b643
Merge branch 'feature/RDK-56115-coverity' of https://github.com/rdkce…
Apr 2, 2025
8f37f99
RDK-56115 : Coverity fix
Apr 2, 2025
6bfd977
RDK-56115 : Fix for coverity in RRD
Apr 2, 2025
4955236
RDK-56115 : Coverity fix
Apr 2, 2025
97e6a6e
RDK-56115: Coverity fix
Apr 2, 2025
e861d4c
RDK-56115 : Dynamic profile Test change
Apr 3, 2025
39b2796
RDK-56115 : Coverity Fix
Apr 3, 2025
b2d91ed
Update rrdJsonParser.c
Saranya2421 Apr 7, 2025
72bd2b1
Update rrdRunCmdThread.c
Saranya2421 Apr 7, 2025
2a58766
Merge branch 'develop' into feature/test-workflows
scthunderbolt Apr 7, 2025
63a43fb
Remove GITHUB_TOKEN
scthunderbolt Apr 7, 2025
b6b5810
Merge pull request #70 from rdkcentral/feature/test-workflows
scthunderbolt Apr 7, 2025
0a9ef31
[RDKE] L2 Tests And Integration With CI for Remote Debugger Dynamic U…
Abhinavpv28 Apr 7, 2025
c3c9c09
Merge branch 'develop' into feature/RDK-56115-coverity
Saranya2421 Apr 15, 2025
ffb99f1
Update test_rrd_debug_report_upload.py
Saranya2421 Apr 15, 2025
8163edc
Update test_rrd_debug_report_upload.py
Saranya2421 Apr 15, 2025
d5447f9
Update test_rrd_debug_report_upload.py
Saranya2421 Apr 17, 2025
cc28e73
Merge pull request #108 from rdkcentral/feature/RDK-56115-coverity
Saranya2421 Apr 21, 2025
33d4cd2
1.2.6 release changelog updates
Apr 28, 2025
76e82bc
Merge branch 'release/1.2.6'
Apr 28, 2025
81ef88a
Merge tag '1.2.6' into develop
Apr 28, 2025
e86dd66
RDK-56291 L2 Tests And Integration With CI for Remote Debugger Dynam…
Abhinavpv28 May 5, 2025
e33aa12
RDKEMW-3380 : Evaluate the Deepsleep Scenario for Static and Dynamic …
Abhinavpv28 May 12, 2025
9ce8a74
Revert " RDK-56291 L2 Tests And Integration With CI for Remote Debugg…
nhanasi May 13, 2025
0f3b06d
RDKEMW-3380 : Evaluate the Deepsleep Scenario for Static and Dynamic …
Abhinavpv28 May 15, 2025
3748ea7
[DELIA-68036] RRD failing in device for some commands, getting invali…
Abhinavpv28 May 16, 2025
d893197
1.2.7 release changelog updates
naveenkumarhanasi May 16, 2025
94ee9ee
Merge branch 'release/1.2.7' into main
naveenkumarhanasi May 19, 2025
37a89a1
Merge tag '1.2.7' into develop
naveenkumarhanasi May 19, 2025
6ae85f4
DELIA-68076: RRD Various commands getting "failed because the control…
AravindanNC May 29, 2025
43c072b
Deploy cla action
rdkcmf-jenkins Jun 24, 2025
778c4c1
DELIA-68122 - RRD device stopped running RRD commands, logs show no p…
Abhinavpv28 Jun 25, 2025
84074ba
1.2.8 release changelog updates
nhanasi Jun 30, 2025
d5b06c7
Merge branch 'release/1.2.8' into main
nhanasi Jun 30, 2025
6a54657
Merge tag '1.2.8' into develop
nhanasi Jun 30, 2025
3f8ad3a
RDKEMW-5275 Improve L1 Coverage for RemoteDebugger (#143)
Abhinavpv28 Jul 30, 2025
8ae3b19
Create Makefile
Abhinavpv28 Aug 15, 2025
cbea8fc
Merge pull request #147 from rdkcentral/feature/deepsleepl2
venkat0557 Aug 29, 2025
4c0a052
Update CODEOWNERS
sbarre01 Sep 22, 2025
1df05e1
Merge branch 'develop' into feature/action-deploy-for/develop
rdkcmf-jenkins Sep 25, 2025
7d615b3
Deploy cla action
rdkcmf-jenkins Sep 25, 2025
0e466a4
Merge pull request #137 from rdkcentral/feature/action-deploy-for/dev…
Alan-Ryan Sep 25, 2025
e941880
Deploy fossid_integration_stateless_diffscan_target_repo action
rdkcmf-jenkins Sep 29, 2025
1f51cb5
Merge pull request #163 from rdkcentral/feature/actions/develop-fossid
Alan-Ryan Sep 29, 2025
aafafba
RDK-56291 - [RDKE] Increase L2 Test Coverage For Remote Debugger : Ta…
Abhinavpv28 Oct 1, 2025
534594c
RRD 1.2.9 release changelog updates
naveenkumarhanasi Oct 1, 2025
300d29e
Merge branch 'release/1.2.9' into main
naveenkumarhanasi Oct 1, 2025
d790168
Merge tag '1.2.9' into develop
naveenkumarhanasi Oct 1, 2025
2821691
Add comprehensive HLD documentation for uploadRRDLogs.sh migration to…
Vismalskumar0 Dec 4, 2025
f323458
Topic/final changeset (#169)
Vismalskumar0 Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @rdkcentral/rdke_ghec_sysint_maintainer @rdkcentral/rdke_ghec_sysint_admin
* @rdkcentral/rdke_ghec_sysint_maintainer
361 changes: 361 additions & 0 deletions .github/docs/uploadRRDLogs_Flowcharts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,361 @@
# uploadRRDLogs - Flowchart Documentation

## Document Information
- **Component Name:** uploadRRDLogs (C Implementation)
- **Version:** 1.0
- **Date:** December 1, 2025

## 1. Main Program Flowchart

### 1.1 Overall Program Flow (Mermaid)

```mermaid
flowchart TD
Start([Start uploadRRDLogs]) --> ValidateArgs{Validate<br/>argc == 3?}
ValidateArgs -->|No| PrintUsage[Print Usage Message]
PrintUsage --> Exit1[Exit Code 1]

ValidateArgs -->|Yes| StoreArgs[Store UPLOADDIR<br/>and ISSUETYPE]
StoreArgs --> InitLog[Initialize Logging<br/>Subsystem]
InitLog --> LoadConfig[Load Configuration<br/>from Multiple Sources]

LoadConfig --> ConfigOK{Config<br/>Valid?}
ConfigOK -->|No| LogConfigError[Log Configuration Error]
LogConfigError --> Exit2[Exit Code 2]

ConfigOK -->|Yes| GetMAC[Get MAC Address<br/>from System]
GetMAC --> MACOK{MAC<br/>Retrieved?}
MACOK -->|No| LogMACError[Log MAC Error]
LogMACError --> Exit2

MACOK -->|Yes| GetTimestamp[Generate Timestamp<br/>YYYY-MM-DD-HH-MM-SS]
GetTimestamp --> ValidateDir{Source Dir<br/>Exists and<br/>Not Empty?}

ValidateDir -->|No| LogDirError[Log Directory Empty/Missing]
LogDirError --> Exit3[Exit Code 0]

ValidateDir -->|Yes| ConvertIssue[Convert ISSUETYPE<br/>to Uppercase]
ConvertIssue --> CheckSpecial{Issue Type ==<br/>LOGUPLOAD_ENABLE?}

CheckSpecial -->|Yes| MoveLiveLogs[Move RRD_LIVE_LOGS.tar.gz<br/>to Source Directory]
MoveLiveLogs --> GenFilename
CheckSpecial -->|No| GenFilename[Generate Archive Filename<br/>MAC_ISSUE_TIME_RRD_DEBUG_LOGS.tgz]

GenFilename --> CreateArchive[Create tar.gz Archive<br/>from Source Directory]
CreateArchive --> ArchiveOK{Archive<br/>Created?}

ArchiveOK -->|No| LogArchiveError[Log Archive Error]
LogArchiveError --> Cleanup1[Cleanup Partial Files]
Cleanup1 --> Exit3B[Exit Code 3]

ArchiveOK -->|Yes| CheckLock{Check Upload<br/>Lock File<br/>/tmp/.log-upload.pid}

CheckLock -->|Exists| WaitLock[Wait 60 seconds]
WaitLock --> IncAttempt[Increment Attempt Counter]
IncAttempt --> MaxAttempts{Attempts<br/> <= 10?}
MaxAttempts -->|Yes| CheckLock
MaxAttempts -->|No| LogLockTimeout[Log Lock Timeout Error]
LogLockTimeout --> Cleanup2[Remove Archive and Source]
Cleanup2 --> Exit4[Exit Code 4]

CheckLock -->|Not Exists| InvokeUpload[Call liblogupload API<br/>logupload_upload with callbacks]
InvokeUpload --> UploadOK{Upload<br/>Success?}

UploadOK -->|No| LogUploadFail[Log Upload Failure]
LogUploadFail --> Cleanup3[Remove Archive and Source]
Cleanup3 --> Exit4B[Exit Code 4]

UploadOK -->|Yes| LogUploadSuccess[Log Upload Success]
LogUploadSuccess --> Cleanup4[Remove Archive and Source]
Cleanup4 --> CleanupOK{Cleanup<br/>Success?}

CleanupOK -->|No| LogCleanupWarn[Log Cleanup Warning]
LogCleanupWarn --> Exit0[Exit Code 0]
CleanupOK -->|Yes| Exit0

Exit1 --> End([End])
Exit2 --> End
Exit3 --> End
Exit3B --> End
Exit4 --> End
Exit4B --> End
Exit0 --> End
```

## 2. Configuration Loading Flowchart

### 2.1 Configuration Loading (Mermaid)

```mermaid
flowchart TD
Start([Start Config Loading]) --> InitStruct[Initialize Config Structure<br/>with Defaults]
InitStruct --> LoadInclude[Load /etc/include.properties]
LoadInclude --> IncludeOK{File<br/>Loaded?}

IncludeOK -->|No| LogIncludeWarn[Log Warning]
IncludeOK -->|Yes| ParseInclude[Parse Properties]
LogIncludeWarn --> LoadDevice
ParseInclude --> LoadDevice[Load /etc/device.properties]

LoadDevice --> DeviceOK{File<br/>Loaded?}
DeviceOK -->|No| LogDeviceWarn[Log Warning]
DeviceOK -->|Yes| ParseDevice[Parse Properties]
LogDeviceWarn --> CheckBuildType
ParseDevice --> CheckBuildType{BUILD_TYPE == prod<br/>AND /opt/dcm.properties<br/>exists?}

CheckBuildType -->|Yes| LoadOptDCM[Load /opt/dcm.properties<br/>OVERRIDE RFC]
LoadOptDCM --> ParseOptDCM[Parse DCM Properties]
ParseOptDCM --> ValidateConfig

CheckBuildType -->|No| QueryRBus[Query RFC via RBus API:<br/>LogServerUrl, SsrUrl]
QueryRBus --> ParseRFC[Store RFC values]
ParseRFC --> LoadDCMSettings[Load /tmp/DCMSettings.conf]

LoadDCMSettings --> DCMSettingsOK{File<br/>Exists?}
DCMSettingsOK -->|No| LoadFallbackDCM
DCMSettingsOK -->|Yes| ParseDCMSettings[Parse DCM Settings:<br/>- UploadRepository:URL<br/>- uploadProtocol]
ParseDCMSettings --> ValidateConfig

DCMSettingsOK -->|No| LoadFallbackDCM[Load dcm.properties<br/>/opt or /etc]
LoadFallbackDCM --> FallbackOK{File<br/>Loaded?}
FallbackOK -->|No| LogFallbackError[Log Error]
LogFallbackError --> ReturnError[Return Error]
FallbackOK -->|Yes| ParseFallbackDCM[Parse Fallback DCM]
ParseFallbackDCM --> ValidateConfig

ValidateConfig{LOG_SERVER and<br/>HTTP_UPLOAD_LINK<br/>not empty?}
ValidateConfig -->|No| SetDefaults[Set Default Protocol<br/>HTTP if missing]
SetDefaults --> StillInvalid{Required<br/>Values<br/>Missing?}
StillInvalid -->|Yes| ReturnError
StillInvalid -->|No| LogConfig

ValidateConfig -->|Yes| LogConfig[Log Configuration Summary]
LogConfig --> ReturnSuccess[Return Success]

ReturnError --> End([End])
ReturnSuccess --> End
```

## 3. Archive Creation Flowchart

### 3.1 Archive Creation (Mermaid)

```mermaid
flowchart TD
Start([Start Archive Creation]) --> ChangeDir[Change to Working Directory<br/>/tmp/rrd/]
ChangeDir --> DirOK{Directory<br/>Accessible?}

DirOK -->|No| LogDirError[Log Directory Error]
LogDirError --> ReturnError[Return Error Code 3]

DirOK -->|Yes| GenFilename[Generate Archive Filename<br/>MAC_ISSUE_TIMESTAMP_RRD_DEBUG_LOGS.tgz]
GenFilename --> CheckSpace{Check<br/>Disk Space<br/>Available?}

CheckSpace -->|No| LogSpaceError[Log Disk Space Error]
LogSpaceError --> ReturnError

CheckSpace -->|Yes| UseLibarchive[Use libarchive API<br/>(Required Dependency)]
UseLibarchive --> InitArchive[archive_write_new]
InitArchive --> SetGzip[archive_write_add_filter_gzip]
SetGzip --> SetFormat[archive_write_set_format_ustar]
SetFormat --> OpenArchive[archive_write_open_filename]
OpenArchive --> OpenOK{Open<br/>Success?}

OpenOK -->|No| LogOpenError[Log Open Error]
LogOpenError --> ReturnError

OpenOK -->|Yes| OpenSourceDir[Open Source Directory]
OpenSourceDir --> ReadEntry[Read Directory Entry]
ReadEntry --> MoreEntries{More<br/>Entries?}

MoreEntries -->|No| CloseArchive[archive_write_close]
CloseArchive --> VerifyArchive

MoreEntries -->|Yes| IsFile{Is Regular<br/>File?}
IsFile -->|No| ReadEntry

IsFile -->|Yes| CreateHeader[Create Archive Entry Header]
CreateHeader --> WriteHeader[archive_write_header]
WriteHeader --> OpenFile[Open Source File]
OpenFile --> FileOK{File<br/>Opened?}

FileOK -->|No| LogFileWarn[Log Warning]
LogFileWarn --> ReadEntry

FileOK -->|Yes| ReadBlock[Read File Block<br/>8KB buffer]
ReadBlock --> BlockData{Data<br/>Read?}

BlockData -->|Yes| WriteBlock[archive_write_data]
WriteBlock --> ReadBlock

BlockData -->|No| CloseFile[Close Source File]
CloseFile --> FinishEntry[archive_write_finish_entry]
FinishEntry --> ReadEntry

VerifyArchive{Archive File<br/>Exists and<br/>Size > 0?}

VerifyArchive -->|No| LogVerifyError[Log Verification Error]
LogVerifyError --> ReturnError

VerifyArchive -->|Yes| LogSuccess[Log Archive Created]
LogSuccess --> ReturnSuccess[Return Success]

ReturnError --> End([End])
ReturnSuccess --> End
```

## 4. Upload Management Flowchart

### 4.1 Upload with Lock Management (Mermaid)

```mermaid
flowchart TD
Start([Start Upload Process]) --> InitVars[Initialize Variables:<br/>attempt = 1<br/>max_attempts = 10<br/>wait_seconds = 60]
InitVars --> CheckLock{Check Lock File<br/>/tmp/.log-upload.pid<br/>exists?}

CheckLock -->|Not Exists| LogProceed[Log: Lock Free, Proceeding]
LogProceed --> ChangeDir[Change to Working Dir<br/>/tmp/rrd/]

CheckLock -->|Exists| LogWait[Log: Upload Lock Detected<br/>Waiting 60 seconds]
LogWait --> Sleep[Sleep 60 seconds]
Sleep --> IncAttempt[Increment attempt]
IncAttempt --> CheckMax{attempt <=<br/>max_attempts?}

CheckMax -->|No| LogTimeout[Log: Lock Timeout Error]
LogTimeout --> ReturnLockError[Return Error Code 4]

CheckMax -->|Yes| CheckLock

ChangeDir --> DirOK{Directory<br/>Change OK?}
DirOK -->|No| LogDirError[Log Directory Error]
LogDirError --> ReturnError[Return Error Code 4]

DirOK -->|Yes| PrepareParams[Prepare liblogupload params:<br/>- server_url<br/>- protocol<br/>- archive_path<br/>- callbacks structure]

PrepareParams --> LogCall[Log: Calling liblogupload API]
LogCall --> CallAPI[Call logupload_upload()<br/>with params and callbacks]

CallAPI --> MonitorCallbacks[Monitor callbacks:<br/>- on_progress<br/>- on_status<br/>- on_error]

MonitorCallbacks --> CheckResult{Return<br/>Code?}

CheckResult -->|LOGUPLOAD_SUCCESS| LogUploadSuccess[Log Upload Success]
LogUploadSuccess --> ReturnSuccess[Return Success Code 0]

ReturnLockError --> End([End])
ReturnError --> End
ExitChild --> End
ReturnSuccess --> End
```

## 5. Cleanup Operations Flowchart

### 5.1 Cleanup Process (Mermaid)

```mermaid
flowchart TD
Start([Start Cleanup]) --> InputParams[Input Parameters:<br/>- archive_path<br/>- source_dir<br/>- upload_status]

InputParams --> LogStart[Log: Starting Cleanup]
LogStart --> RemoveArchive[Remove Archive File]
RemoveArchive --> ArchiveRemoved{Archive<br/>Removed?}

ArchiveRemoved -->|No| CheckArchiveExists{Archive<br/>Still Exists?}
CheckArchiveExists -->|Yes| LogArchiveError[Log: Failed to Remove Archive]
CheckArchiveExists -->|No| LogArchiveNotFound[Log: Archive Already Removed]
LogArchiveError --> RemoveSource
LogArchiveNotFound --> RemoveSource

ArchiveRemoved -->|Yes| LogArchiveSuccess[Log: Archive Removed]
LogArchiveSuccess --> RemoveSource[Remove Source Directory<br/>Recursively]

RemoveSource --> SourceRemoved{Source Dir<br/>Removed?}
SourceRemoved -->|No| CheckSourceExists{Source<br/>Still Exists?}
CheckSourceExists -->|Yes| LogSourceError[Log: Failed to Remove Source]
CheckSourceExists -->|No| LogSourceNotFound[Log: Source Already Removed]
LogSourceError --> DetermineResult
LogSourceNotFound --> DetermineResult

SourceRemoved -->|Yes| LogSourceSuccess[Log: Source Directory Removed]
LogSourceSuccess --> DetermineResult{Upload<br/>Was Successful?}

DetermineResult -->|Yes| LogCleanupComplete[Log: Cleanup Complete - Upload Success]
LogCleanupComplete --> ReturnSuccess[Return Success]

DetermineResult -->|No| LogCleanupFailed[Log: Cleanup Complete - Upload Failed]
LogCleanupFailed --> ReturnError[Return Error]

ReturnSuccess --> End([End])
ReturnError --> End
```

## 6. Special Case: LOGUPLOAD_ENABLE Flowchart

### 6.1 LOGUPLOAD_ENABLE Handling (Mermaid)

```mermaid
flowchart TD
Start([Check Issue Type]) --> CompareIssue{Issue Type ==<br/>LOGUPLOAD_ENABLE?}

CompareIssue -->|No| SkipSpecial[Skip Special Handling]
SkipSpecial --> ContinueNormal[Continue Normal Flow]

CompareIssue -->|Yes| LogSpecial[Log: Handling LOGUPLOAD_ENABLE]
LogSpecial --> CheckLiveLog{RRD_LIVE_LOGS.tar.gz<br/>exists in /tmp/rrd/?}

CheckLiveLog -->|No| LogNoLive[Log: Live logs not found]
LogNoLive --> ContinueNormal

CheckLiveLog -->|Yes| LogFoundLive[Log: Found live logs file]
LogFoundLive --> MoveLive[Move RRD_LIVE_LOGS.tar.gz<br/>to source directory]
MoveLive --> MoveOK{Move<br/>Success?}

MoveOK -->|No| LogMoveError[Log: Warning - Failed to move live logs]
LogMoveError --> ContinueNormal

MoveOK -->|Yes| LogMoveSuccess[Log: Live logs moved successfully]
LogMoveSuccess --> ContinueNormal

ContinueNormal --> End([Continue to Archive Creation])
```

## 7. Error Handling Decision Tree

### 7.1 Error Handling Flow (Mermaid)

```mermaid
flowchart TD
Start([Error Detected]) --> Categorize{Error<br/>Category?}

Categorize -->|Fatal| LogFatal[Log: FATAL ERROR with context]
LogFatal --> CleanupFatal[Cleanup Resources]
CleanupFatal --> ExitFatal[Exit with Error Code 1-3]

Categorize -->|Recoverable| LogRecover[Log: Recoverable Error]
LogRecover --> CheckRetry{Retry<br/>Available?}
CheckRetry -->|Yes| IncrementRetry[Increment Retry Counter]
IncrementRetry --> CheckMaxRetry{Max Retries<br/>Exceeded?}
CheckMaxRetry -->|No| RetryOperation[Retry Operation]
RetryOperation --> End1([Return to Operation])
CheckMaxRetry -->|Yes| LogMaxRetry[Log: Max Retries Exceeded]
LogMaxRetry --> CleanupRecover[Cleanup Resources]
CleanupRecover --> ExitRecover[Exit with Error Code 4]
CheckRetry -->|No| TryFallback{Fallback<br/>Available?}
TryFallback -->|Yes| UseFallback[Use Fallback Method]
UseFallback --> End2([Return to Operation])
TryFallback -->|No| CleanupRecover

Categorize -->|Warning| LogWarning[Log: WARNING with context]
LogWarning --> MarkWarning[Set Warning Flag]
MarkWarning --> ContinueWarn[Continue Operation]
ContinueWarn --> End3([Return to Operation])

ExitFatal --> End([Program Termination])
ExitRecover --> End
```

## Document Revision History

| Version | Date | Author | Changes |
|---------|------|--------|---------|
| 1.0 | December 1, 2025 | Vismal | Initial flowchart documentation |
Loading
Loading