| 954 | |
| 955 | |
| 956 | void GroupProcess::abort(const string& message) |
| 957 | { |
| 958 | // Set the error variable so that the group becomes unfunctional. |
| 959 | error = Error(message); |
| 960 | |
| 961 | LOG(ERROR) << "Group aborting: " << message; |
| 962 | |
| 963 | // Cancel the retries. |
| 964 | retrying = false; |
| 965 | |
| 966 | fail(&pending.joins, message); |
| 967 | fail(&pending.cancels, message); |
| 968 | fail(&pending.datas, message); |
| 969 | fail(&pending.watches, message); |
| 970 | |
| 971 | // Set all owned memberships as cancelled. |
| 972 | foreachvalue (Promise<bool>* cancelled, owned) { |
| 973 | cancelled->set(false); // Since this was not requested. |
| 974 | delete cancelled; |
| 975 | } |
| 976 | |
| 977 | owned.clear(); |
| 978 | |
| 979 | // Since we decided to abort, we expire the session to clean up |
| 980 | // ephemeral ZNodes as necessary. |
| 981 | delete CHECK_NOTNULL(zk); |
| 982 | delete CHECK_NOTNULL(watcher); |
| 983 | zk = nullptr; |
| 984 | watcher = nullptr; |
| 985 | } |
| 986 | |
| 987 | |
| 988 | string GroupProcess::zkBasename(const Group::Membership& membership) |