#147 fixed bug with the fix for startup race condition with RTUs

This commit is contained in:
Mikayla Fischler
2023-04-09 14:25:22 -04:00
parent fa88392438
commit 4ef73a8580
2 changed files with 13 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
local sps_rtu = require("rtu.dev.sps_rtu")
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
local RTU_VERSION = "v0.13.1"
local RTU_VERSION = "v0.13.2"
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
@@ -372,6 +372,17 @@ local function main()
return false
end
if is_multiblock then
if not formed then
log.info(util.c("configure> device '", name, "' is not formed"))
elseif faulted then
-- sometimes there is a race condition on server boot where it reports formed, but
-- the other functions are not yet defined (that's the theory at least). mark as unformed to attempt connection later
formed = false
log.warning(util.c("configure> device '", name, "' is formed, but initialization had one or more faults: marked as unformed"))
end
end
---@class rtu_unit_registry_entry
local rtu_unit = {
uid = 0, ---@type integer
@@ -392,17 +403,6 @@ local function main()
table.insert(units, rtu_unit)
if is_multiblock then
if not formed then
log.info(util.c("configure> device '", name, "' is not formed"))
elseif faulted then
-- sometimes there is a race condition on server boot where it reports formed, but
-- the other functions are not yet defined (that's the theory at least). mark as unformed to attempt connection later
formed = false
log.warning(util.c("configure> device '", name, "' is formed, but initialization had one or more faults: marked as unformed"))
end
end
local for_message = "facility"
if for_reactor > 0 then
for_message = util.c("reactor ", for_reactor)