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

Error report from SIX #24

Open
mrakitin opened this issue Sep 27, 2019 · 7 comments
Open

Error report from SIX #24

mrakitin opened this issue Sep 27, 2019 · 7 comments

Comments

@mrakitin
Copy link
Member

mrakitin commented Sep 27, 2019

Reported by @pelliciari

Trac xref: #3935: CCD stopped working

gvbt1 close 140707549724008
---------------------------------------------------------------------------
RedundantStaging Traceback (most recent call last)
~/science_comm/304795_Dietl.py in <module>
----> 1 RE(energy_map_thin_CRO_v2())

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/run_engine.py in __call__(self, *args, **metadata_kw)
751 # it (unless it is a canceled error)
752 if exc is not None:
--> 753 raise exc
754
755 if self._interrupted:

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/run_engine.py in _run(self)
1260 self._reason = str(err)
1261 self.log.exception("Run aborted")
-> 1262 raise err
1263 finally:
1264 # Some done_callbacks may still be alive in other threads.

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/run_engine.py in _run(self)
1125 try:
1126 msg = self._plan_stack[-1].throw(
-> 1127 self._exception or resp)
1128 except Exception as e:
1129 # The current plan did not handle it,

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in __call__(self, plan)
1292 plan = monitor_during_wrapper(plan, self.monitors)
1293 plan = baseline_wrapper(plan, self.baseline)
-> 1294 return (yield from plan)

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in baseline_wrapper(plan, devices, name)
1147 return (yield from plan)
1148 else:
-> 1149 return (yield from plan_mutator(plan, insert_baseline))
1150
1151

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
75 # if we have a stashed exception, pass it along
76 try:
---> 77 msg = plan_stack[-1].throw(exception)
78 except StopIteration as e:
79 # discard the exhausted generator

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in monitor_during_wrapper(plan, signals)
788 plan1 = plan_mutator(plan, insert_after_open)
789 plan2 = plan_mutator(plan1, insert_before_close)
--> 790 return (yield from plan2)
791
792

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
75 # if we have a stashed exception, pass it along
76 try:
---> 77 msg = plan_stack[-1].throw(exception)
78 except StopIteration as e:
79 # discard the exhausted generator

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
75 # if we have a stashed exception, pass it along
76 try:
---> 77 msg = plan_stack[-1].throw(exception)
78 except StopIteration as e:
79 # discard the exhausted generator

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in fly_during_wrapper(plan, flyers)
846 plan1 = plan_mutator(plan, insert_after_open)
847 plan2 = plan_mutator(plan1, insert_before_close)
--> 848 return (yield from plan2)
849
850

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
75 # if we have a stashed exception, pass it along
76 try:
---> 77 msg = plan_stack[-1].throw(exception)
78 except StopIteration as e:
79 # discard the exhausted generator

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
75 # if we have a stashed exception, pass it along
76 try:
---> 77 msg = plan_stack[-1].throw(exception)
78 except StopIteration as e:
79 # discard the exhausted generator

~/science_comm/304795_Dietl.py in energy_map_thin_CRO_v2()
17 for i in E:
18 sec_x_pt = 5
---> 19 yield from rixs_one_energy_1(sec_x_pt,total_time,cyc,i,ext_vg,
'E_map_thin_film')
20
21

~/science_comm/304795_Dietl.py in rixs_one_energy_1(split_time, total_exp,
cycles, energy, ext_vg, reason, disable_sclr_plt)
86 except Exception:
87 print('\n\nOOPS! Possibly you stopped rixs_one_energy()')
---> 88 yield from rixs_cleanup(1)
89 #return fails
90 raise

~/science_comm/304795_Dietl.py in rixs_cleanup(sclr_set_time_n)
33 print('\n\n...............Cleaning up................\n\n')
34 yield from sleep(1)
---> 35 yield from pzshutter_disable()
36 sclr_enable()
37 yield from mv(sclr.preset_time,sclr_set_time_n)

~/science_comm/304795_Dietl.py in pzshutter_disable()
135 yield from mv(rixscam.cam.acquire_time, rixscam_exp)
136 yield from mv(pzshutter,'None')
--> 137 yield from snap([rixscam])#, num=1, md = {'reason': 'enable
pzshutter'})
138 yield from mv(rixscam.cam.acquire_time, rixscam_exp_temp)
139

~/science_comm/304795_Dietl.py in snap(dets)
113 def snap(dets):
114 for d in dets:
--> 115 yield from bps.stage(d)
116 for d in dets:
117 yield from bps.trigger(d, group='snap')

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/plan_stubs.py in stage(obj)
584 :func:`bluesky.plan_stubs.unstage`
585 """
--> 586 return (yield Msg('stage', obj))
587
588

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
192 try:
193 # yield out the 'current message' and collect the return
--> 194 inner_ret = yield msg
195 except GeneratorExit:
196 # special case GeneratorExit. We must clean up all of our plans

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
192 try:
193 # yield out the 'current message' and collect the return
--> 194 inner_ret = yield msg
195 except GeneratorExit:
196 # special case GeneratorExit. We must clean up all of our plans

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
192 try:
193 # yield out the 'current message' and collect the return
--> 194 inner_ret = yield msg
195 except GeneratorExit:
196 # special case GeneratorExit. We must clean up all of our plans

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
192 try:
193 # yield out the 'current message' and collect the return
--> 194 inner_ret = yield msg
195 except GeneratorExit:
196 # special case GeneratorExit. We must clean up all of our plans

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc)
192 try:
193 # yield out the 'current message' and collect the return
--> 194 inner_ret = yield msg
195 except GeneratorExit:
196 # special case GeneratorExit. We must clean up all of our plans

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/run_engine.py in _run(self)
1206 # exceptions (coming in via throw) can be
1207 # raised
-> 1208 new_response = yield from coro(msg)
1209
1210 # special case `CancelledError` and let the outer

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/bluesky/run_engine.py in _stage(self, msg)
2212 if not hasattr(obj, 'stage'):
2213 return []
-> 2214 result = obj.stage()
2215 self._staged.add(obj) # add first in case of failure below
2216 yield from self._reset_checkpoint_state_coro()

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/ophyd/areadetector/trigger_mixins.py in stage(self)
119 def stage(self):
120 self._acquisition_signal.subscribe(self._acquire_changed)
--> 121 super().stage()
122
123 def unstage(self):

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/ophyd/areadetector/base.py in stage(self, *args, **kwargs)
156
157 def stage(self, *args, **kwargs):
--> 158 ret = super().stage(*args, **kwargs)
159 try:
160 self.validate_asyn_ports()

/opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-
packages/ophyd/device.py in stage(self)
569 "Maybe the most recent unstaging "
570 "encountered an error before finishing. "
--> 571 "Try unstaging again.".format(self))
572 self.log.debug("Staging %s", self.name)
573 self._staged = Staged.partially

RedundantStaging: Device RIXSCam(prefix='XF:02ID1-ES{RIXSCam}:',
name='rixscam', read_attrs=['xip', 'xip.count_possible_event',
'xip.count_above_threshold', 'xip.count_below_threshold',
'xip.count_neighbours', 'xip.count_event_2x2', 'xip.count_event_3x3',
'hdf5', 'hdf2'], configuration_attrs=['cam', 'cam.acquire_period',
'cam.acquire_time', 'cam.num_images', 'cam.temperature',
'cam.temperature_actual', 'cam.trigger_mode', 'centroid_enable', 'xip',
'xip.configuration_names', 'xip.port_name', 'xip.asyn_pipeline_config',
'xip.blocking_callbacks', 'xip.enable', 'xip.nd_array_port',
'xip.plugin_type', 'xip.algorithm', 'xip.output_mode',
'xip.bkgd_update_mode', 'xip.bkgd_value', 'xip.sum_3x3_threshold_min',
'xip.sum_3x3_threshold_max', 'xip.hist_start', 'xip.hist_bin_width',
'xip.hist_bin_count', 'xip.source_region', 'xip.dim0_region_start',
'xip.dim0_region_size', 'xip.dim1_region_start', 'xip.dim1_region_size',
'xip.x_expansion_factor', 'xip.y_expansion_factor',
'xip.centroid_correction', 'xip.beamline_energy',
'xip.isolinear_correction', 'xip.isolinear_coefficient_x2_1',
'xip.isolinear_coefficient_x1_1', 'xip.isolinear_coefficient_x0_1',
'xip.isolinear_coefficient_x2_2', 'xip.isolinear_coefficient_x1_2',
'xip.isolinear_coefficient_x0_2', 'xip.isolinear_threshold', 'hdf5',
'hdf5.configuration_names', 'hdf5.port_name', 'hdf5.asyn_pipeline_config',
'hdf5.blocking_callbacks', 'hdf5.enable', 'hdf5.nd_array_port',
'hdf5.plugin_type', 'hdf5.auto_increment', 'hdf5.auto_save',
'hdf5.file_format', 'hdf5.file_name', 'hdf5.file_path',
'hdf5.file_path_exists', 'hdf5.file_template', 'hdf5.file_write_mode',
'hdf5.full_file_name', 'hdf5.num_capture', 'hdf5.boundary_align',
'hdf5.boundary_threshold', 'hdf5.compression', 'hdf5.data_bits_offset',
'hdf5.extra_dim_name', 'hdf5.extra_dim_size', 'hdf5.io_speed',
'hdf5.num_col_chunks', 'hdf5.num_data_bits', 'hdf5.num_extra_dims',
'hdf5.num_frames_chunks', 'hdf5.num_frames_flush', 'hdf5.num_row_chunks',
'hdf5.run_time', 'hdf5.szip_num_pixels', 'hdf5.store_attr',
'hdf5.store_perform', 'hdf5.zlevel', 'hdf2', 'hdf2.configuration_names',
'hdf2.port_name', 'hdf2.asyn_pipeline_config', 'hdf2.blocking_callbacks',
'hdf2.enable', 'hdf2.nd_array_port', 'hdf2.plugin_type',
'hdf2.auto_increment', 'hdf2.auto_save', 'hdf2.file_format',
'hdf2.file_name', 'hdf2.file_path', 'hdf2.file_path_exists',
'hdf2.file_template', 'hdf2.file_write_mode', 'hdf2.full_file_name',
'hdf2.num_capture', 'hdf2.boundary_align', 'hdf2.boundary_threshold',
'hdf2.compression', 'hdf2.data_bits_offset', 'hdf2.extra_dim_name',
'hdf2.extra_dim_size', 'hdf2.io_speed', 'hdf2.num_col_chunks',
'hdf2.num_data_bits', 'hdf2.num_extra_dims', 'hdf2.num_frames_chunks',
'hdf2.num_frames_flush', 'hdf2.num_row_chunks', 'hdf2.run_time',
'hdf2.szip_num_pixels', 'hdf2.store_attr', 'hdf2.store_perform',
'hdf2.zlevel', 'set_node', 'sensor_region_xsize', 'sensor_region_ysize',
'sensor_region_xstart', 'sensor_region_ystart', 'sensor_binning_x',
'sensor_binning_y', 'ccd1_hv', 'ccd2_hv']) has been partially staged.
Maybe the most recent unstaging encountered an error before finishing. Try
unstaging again.
@mrakitin
Copy link
Member Author

I think it happens due to a possibly failing snap(...) function

def snap(dets):
for d in dets:
yield from bps.stage(d)
for d in dets:
yield from bps.trigger(d, group='snap')
yield from bps.wait(group='snap')
for d in dets:
yield from bps.unstage(d)

which is called here from the user plan:

yield from snap([rixscam])#, num=1, md = {'reason': 'enable pzshutter'})

If something wrong happens on the staging/triggering steps, it does not unstage cleanly. We need a proper finalize_wrapper for this case.

@tacaswell, does it sound right?

@mrakitin
Copy link
Member Author

October 7-9 (Mon-Wed), 2019 is a short shutdown, and a good time to test the fix.

@mrakitin
Copy link
Member Author

@mrakitin
Copy link
Member Author

See @awalter-bnl's points at #20 (comment) (for the same issue).

@mrakitin
Copy link
Member Author

The solution can be similar to https://github.com/NSLS-II-XFP/profile_collection/blob/bda09abf80e2813391d1c7d93ab6b06f7c61b302/startup/99-gui-ht.py#L768-L769:

        return (yield from bpp.finalize_wrapper(main_plan(file_name),
                                                close_shutters()))

@rixssix
Copy link

rixssix commented Sep 30, 2019

Time lags between the Capturing and Done states observed today by @pelliciari and @mrakitin:

xf02id1@xf02id1-ws2:~$ camonitor XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:06:11.688936 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:09:38.405874 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:09:44.227843 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:09:57.996993 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:10:03.696253 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:10:12.205934 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:10:21.879007 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:10:25.231996 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:10:34.140995 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:10:37.423567 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:11:03.549940 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:11:29.625004 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:11:38.588618 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:11:41.896796 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:12:19.299219 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:12:32.727152 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:12:41.436753 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:12:44.744201 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:13:09.401584 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:13:09.502246 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:13:15.223262 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:13:30.427254 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:13:36.152875 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:13:44.395034 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:13:59.810014 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:14:03.761058 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:14:12.700546 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:14:15.963328 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:14:24.652823 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:14:27.922370 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:14:52.641428 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:15:18.552642 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:26:17.708455 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:26:18.498557 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:26:24.402457 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:26:31.892295 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:26:42.741474 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:26:46.004855 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:03.839286 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:07.082836 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:16.355626 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:21.107792 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:30.132312 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:33.368331 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:42.501618 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:45.687533 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:54.775898 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:27:58.734347 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:28:07.969341 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:28:11.247431 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:28:20.234263 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:28:25.036307 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:28:33.858882 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:28:37.100068 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:28:46.341464 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:28:49.580963 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:00.915942 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:04.108820 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:12.897763 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:16.143535 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:29.095002 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:33.020324 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:42.010960 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:45.236908 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:53.998360 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:29:57.283548 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:30:09.653856 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:30:12.806021 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:30:21.768497 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:30:25.914926 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:30:35.040003 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:30:39.107712 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:30:47.976278 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:30:51.247683 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:00.061259 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:03.286070 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:12.403552 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:16.409229 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:25.412741 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:29.436153 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:38.545215 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:42.650042 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:51.606099 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:31:54.869020 Capturing STATE MINOR
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:32:04.157418 Done  
XF:02ID1-ES{RIXSCam}:HDF1:Capture_RBV 2019-09-30 17:32:07.423394 Capturing STATE MINOR

@danielballan
Copy link
Contributor

Another way to ensure cleanup is to reuse the @stage_decorator, which uses finalize_wrapper internally. Mileage may vary on whether this looks simpler or not, but it has the virtue of taking the same approach that built-in plans like count do.

 def snap(dets):  
    @stage_decorator(dets)
    def inner_snap():
        for d in dets:  
             yield from bps.trigger(d, group='snap') 
        yield from bps.wait(group='snap')  
    yield from inner_snap()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants