Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
4b58b31d
Commit
4b58b31d
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-391
: Obtain proxies in separate thread because it may stall
parent
70b14840
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/devices/boot.py
+12
-8
12 additions, 8 deletions
devices/devices/boot.py
with
12 additions
and
8 deletions
devices/devices/boot.py
+
12
−
8
View file @
4b58b31d
...
@@ -59,13 +59,7 @@ class DevicesInitialiser(Thread):
...
@@ -59,13 +59,7 @@ class DevicesInitialiser(Thread):
def
__init__
(
self
,
device_names
,
ignore_unavailable_devices
=
True
,
proxy_timeout
=
10.0
):
def
__init__
(
self
,
device_names
,
ignore_unavailable_devices
=
True
,
proxy_timeout
=
10.0
):
self
.
ignore_unavailable_devices
=
ignore_unavailable_devices
self
.
ignore_unavailable_devices
=
ignore_unavailable_devices
# Since Python3.7+, the insertion order equals the iteration order, which is what we depend on
self
.
device_names
=
device_names
# to process the devices in the same order as in device_names.
self
.
devices
=
{
name
:
DeviceProxy
(
name
)
for
name
in
device_names
}
# set the timeout for all proxies
for
device
in
self
.
devices
.
values
():
device
.
set_timeout_millis
(
int
(
proxy_timeout
*
1000
))
# setup initial state
# setup initial state
self
.
progress
=
0
self
.
progress
=
0
...
@@ -77,7 +71,17 @@ class DevicesInitialiser(Thread):
...
@@ -77,7 +71,17 @@ class DevicesInitialiser(Thread):
self
.
set_status
(
"
Starting initialisation
"
)
self
.
set_status
(
"
Starting initialisation
"
)
try
:
try
:
self
.
initialise_devices
()
# Since Python3.7+, the insertion order equals the iteration order, which is what we depend on
# to process the devices in the same order as in device_names.
self
.
devices
=
{}
for
name
in
self
.
device_names
:
self
.
set_status
(
f
"
Obtaining a DeviceProxy to
{
name
}
"
)
self
.
devices
[
name
]
=
DeviceProxy
(
name
)
# set the timeout for all proxies
for
device
in
self
.
devices
.
values
():
device
.
set_timeout_millis
(
int
(
proxy_timeout
*
1000
))
self
.
initialise_devices
()
self
.
set_status
(
"
Initialisation completed
"
)
self
.
set_status
(
"
Initialisation completed
"
)
except
Exception
as
e
:
except
Exception
as
e
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment