openbmc / phosphor-time-manager

Local time policy and emulated host RTC manager
Apache License 2.0
6 stars 9 forks source link

error in setting epoch time immediately after time-sync mode changed to Manual #6

Open sumithcl2020 opened 3 years ago

sumithcl2020 commented 3 years ago

we have observed below point while working with phosphor-time-manager.

  1. if we set time mode to manual and try to set epoch time immediately using Elapsed property, we encounter the below error: "Failed to set property Elapsed on interface xyz.openbmc_project.Time.EpochTime: The operation failed" 2.if we wait for few seconds(5-8 seconds assumed) and then set epoch time using Elapsed property then we are able to set the BMC time successfully.

query: 1.Is the above behavior known or a bug?. is it documented in the repo?.

possible suggestion: if we want to set epoch time immediately after manual mode then we suggest below solution:

  1. when we changed mode from NTP to Manual , phosphor-TimeManager service disables the NTPSync which actually takes a few seconds. so when we try to set time immediately(NTPSync will still be in enabled phase) timedate service gives error that previous operation is still in progress. 2.To avoid the error we can wait for NTPSync to be disabled before setting time in cpp file.
leiyu-bytedance commented 3 years ago

I think this is the same issue as https://github.com/openbmc/openbmc/issues/3459, and is mentioned in the README.md