Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply cb lock #3234

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
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
15 changes: 8 additions & 7 deletions src/radical/pilot/pilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,18 @@ def _update(self, pilot_dict):

# invoke pilot specific callbacks
# FIXME: this iteration needs to be thread-locked!
Copy link
Contributor

Choose a reason for hiding this comment

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

I am assuming the line with self._cb_lock did fix the FIXME above it? If so then let's remove the FIXME

for _,cb_val in self._callbacks[rpc.PILOT_STATE].items():
with self._cb_lock:
for _,cb_val in self._callbacks[rpc.PILOT_STATE].items():

cb = cb_val['cb']
cb_data = cb_val['cb_data']
cb = cb_val['cb']
cb_data = cb_val['cb_data']

self._log.debug('call %s', cb)
self._log.debug('call %s', cb)

self._log.debug('%s calls cb %s', self.uid, cb)
self._log.debug('%s calls cb %s', self.uid, cb)

if cb_data: cb([self], cb_data)
else : cb([self])
if cb_data: cb([self], cb_data)
else : cb([self])

# ask pmgr to invoke any global callbacks
self._pmgr._call_pilot_callbacks(self)
Expand Down
Loading