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

Stop services on error #300

Open
k1o0 opened this issue May 5, 2020 · 0 comments
Open

Stop services on error #300

k1o0 opened this issue May 5, 2020 · 0 comments

Comments

@k1o0
Copy link
Contributor

k1o0 commented May 5, 2020

Is your feature request related to a problem? Please describe.
When there is an error the services should be stopped by expServer.

Describe the solution you'd like
Upon an error the cleanup method is run, however the cleanup event is not triggered. Perhaps it should be so that running services are stopped:

Rigbox/+exp/SignalsExp.m

Lines 401 to 419 in cd888f0

%Trigger the 'experimentCleanup' event so any handlers will be called
cleanupInfo = exp.EventInfo('experimentCleanup', obj.Clock.now, obj);
fireEvent(obj, cleanupInfo);
%do our cleanup
cleanup(obj);
%return the data structure that has been built up
data = obj.Data;
if ~isempty(ref)
saveData(obj); %save the data
end
catch ex
obj.IsLooping = false;
%mark that an exception occured in the block data, then save
obj.Data.endStatus = 'exception';
obj.Data.exceptionMessage = ex.message;
obj.cleanup() % TODO Make cleanup more robust to error states

Additionally it could be useful to include an input arg to services stop methods so that exception UDPs can be sent.

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

No branches or pull requests

1 participant