Skip to content

corefile uploader: Updates per review comments offline#3915

Merged
renukamanavalan merged 5 commits intosonic-net:masterfrom
renukamanavalan:core_uploader_upd
Dec 30, 2019
Merged

corefile uploader: Updates per review comments offline#3915
renukamanavalan merged 5 commits intosonic-net:masterfrom
renukamanavalan:core_uploader_upd

Conversation

@renukamanavalan
Copy link
Contributor

  1. core_uploader service waits for syslog.service
  2. core_uploader service enabled for restart on failure
  3. Use mtime instead of file size + ample time to be robust.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

1) core_uploader service waits for syslog.service
2) core_uploader service enabled for restart on failure
3) Use mtime instead of file size + ample time to be robust.
@renukamanavalan
Copy link
Contributor Author

I have not tested the code yet. Can I get your comments please, before I do my last round testing.

1) If rc file is missing or required data missing, it periodically logs error in forever loop.
2) If upload fails, retry every hour with a error log, forever.
@renukamanavalan renukamanavalan changed the title Updates per review comments corefile uploader: Updates per review comments offline Dec 16, 2019
@renukamanavalan
Copy link
Contributor Author

Changes:

  1. The service dependency switched to syslog.service
  2. file_write_complete switch to watching st_mtime instead of size.
  3. Added some time buffer to ensure all write completes.
  4. Upon failure to upload, keep retrying every hour with an error message,

fail_msg = ""

while i <= MAX_RETRIES:
while True:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can do retry in the big loop. if it fails, retry in the big loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess no. The bigger loop is either scan/wait-for-core. In either case, the next one would suffer the same fate. So I rather spew log & retry, until either I succeed or service is restarted, by someone alerted by these log messages.

Type=simple
ExecStart=/usr/bin/core_uploader.py
StandardOutput=null
Restart=on-failure
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need back off here? if core_uploader is constantly restarting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need. The only failure that crashes the service, is some fatal things like, sonic_version.yaml does not have expected attributes or some fatal system related failure (which should crash many more ...), and running out of disk space.

The one thing, I would need to take care of "running out of disk space". This I can take care of inside the script.

@renukamanavalan
Copy link
Contributor Author

vs & vsimage build failure are unrelated to this PR.

console o/p:
"
_```
Step 6/28 : RUN apt-get update && apt-get install -y curl ca-certificates gcc make libdpkg-perl ipmitool
---> Running in bf1b21cffd19
Ign:1 http://debian-archive.trafficmanager.net/debian stretch InRelease
Hit:2 http://debian-archive.trafficmanager.net/debian-security stretch/updates InRelease
Hit:3 http://debian-archive.trafficmanager.net/debian stretch-backports InRelease
Hit:4 http://debian-archive.trafficmanager.net/debian stretch Release
Reading package lists...
�[91mE: Release file for http://debian-archive.trafficmanager.net/debian/dists/stretch-backports/InRelease is expired (invalid since 12min 13s). Updates for this repository will not be applied.
�[0mThe command '/bin/sh -c apt-get update && apt-get install -y curl ca-certificates gcc make libdpkg-perl ipmitool' returned a non-zero code: 100
[ FAIL LOG END ] [ target/docker-snmp-sv2.gz ]
slave.mk:526: recipe for target 'target/docker-snmp-sv2.gz' failed

"

@renukamanavalan renukamanavalan merged commit 78db080 into sonic-net:master Dec 30, 2019
abdosi pushed a commit that referenced this pull request Jan 3, 2020
* Updates per review comments
1) core_uploader service waits for syslog.service
2) core_uploader service enabled for restart on failure
3) Use mtime instead of file size + ample time to be robust.

* Avoid reloading already uploaded file, by marking the names with a prefix.

* Updated failing path.
1) If rc file is missing or required data missing, it periodically logs error in forever loop.
2) If upload fails, retry every hour with a error log, forever.

* Fix few bugs

* The binary update_json.py will come from sonic-utilities.
yxieca pushed a commit that referenced this pull request Jan 6, 2020
* Updates per review comments
1) core_uploader service waits for syslog.service
2) core_uploader service enabled for restart on failure
3) Use mtime instead of file size + ample time to be robust.

* Avoid reloading already uploaded file, by marking the names with a prefix.

* Updated failing path.
1) If rc file is missing or required data missing, it periodically logs error in forever loop.
2) If upload fails, retry every hour with a error log, forever.

* Fix few bugs

* The binary update_json.py will come from sonic-utilities.
@renukamanavalan renukamanavalan deleted the core_uploader_upd branch April 17, 2022 22:08
mssonicbld added a commit that referenced this pull request Jun 25, 2025
…atically (#22920)

#### Why I did it
src/sonic-utilities
```
* ced89eb5 - (HEAD -> 202405, origin/202405) [build] Update Azure pipeline to use Ubuntu 24.04 image (#3915) (2 weeks ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
patrickmacarthur pushed a commit to patrickmacarthur/sonic-buildimage that referenced this pull request Aug 6, 2025
…AD automatically (sonic-net#1225)

#### Why I did it
src/sonic-utilities
```
* de2a0ad2 - (HEAD -> 202405, origin/202405) Merge pull request sonic-net#182 from mssonicbld/sonicbld/202405-merge (21 hours ago) [mssonicbld]
* 713cd7f9 - Merge branch '202405' of https://github.com/sonic-net/sonic-utilities into 202405 (23 hours ago) [Sonic Automation]
* ced89eb5 - [build] Update Azure pipeline to use Ubuntu 24.04 image (sonic-net#3915) (2 days ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants