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

Add specific reasons for failed task submission #375

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
30 changes: 15 additions & 15 deletions protos/Crane.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ message SubmitBatchTaskReply {
bool ok = 1;
oneof payload{
uint32 task_id = 2;
string reason = 3;
ErrCode code = 3;
}
}

Expand All @@ -72,7 +72,7 @@ message SubmitBatchTasksRequest {

message SubmitBatchTasksReply {
repeated uint32 task_id_list = 1;
repeated string reason_list = 2;
repeated ErrCode code_list = 2;
}

message ExecuteTasksRequest {
Expand Down Expand Up @@ -243,7 +243,7 @@ message AddAccountRequest {

message AddAccountReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message AddUserRequest {
Expand All @@ -253,7 +253,7 @@ message AddUserRequest {

message AddUserReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message AddQosRequest {
Expand All @@ -263,7 +263,7 @@ message AddQosRequest {

message AddQosReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message DeleteAccountRequest {
Expand All @@ -273,7 +273,7 @@ message DeleteAccountRequest {

message DeleteAccountReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message DeleteUserRequest {
Expand All @@ -284,7 +284,7 @@ message DeleteUserRequest {

message DeleteUserReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message DeleteQosRequest {
Expand All @@ -294,7 +294,7 @@ message DeleteQosRequest {

message DeleteQosReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message ModifyAccountRequest {
Expand All @@ -308,7 +308,7 @@ message ModifyAccountRequest {

message ModifyAccountReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message ModifyUserRequest {
Expand All @@ -324,7 +324,7 @@ message ModifyUserRequest {

message ModifyUserReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message ModifyQosRequest {
Expand All @@ -336,7 +336,7 @@ message ModifyQosRequest {

message ModifyQosReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message QueryAccountInfoRequest {
Expand All @@ -346,7 +346,7 @@ message QueryAccountInfoRequest {

message QueryAccountInfoReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
repeated AccountInfo account_list = 3;
}

Expand All @@ -358,7 +358,7 @@ message QueryUserInfoRequest {

message QueryUserInfoReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
repeated UserInfo user_list = 3;
}

Expand All @@ -369,7 +369,7 @@ message QueryQosInfoRequest {

message QueryQosInfoReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
repeated QosInfo qos_list = 5;
}

Expand All @@ -383,7 +383,7 @@ message BlockAccountOrUserRequest {

message BlockAccountOrUserReply {
bool ok = 1;
ErrCode reason = 2;
ErrCode code = 2;
}

message MigrateSshProcToCgroupRequest {
Expand Down
130 changes: 71 additions & 59 deletions protos/PublicDefs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -322,65 +322,77 @@ message TrimmedPartitionInfo {
enum ErrCode {
SUCCESS = 0; // Success

ERR_INVALID_UID = 10001; // Invalid UID passed
ERR_INVALID_OP_USER = 10002; // Invalid operation user
ERR_INVALID_USER = 10003; // Invalid user
ERR_PERMISSION_USER = 10004; // User permissions too low, no permission to operate
ERR_USER_DUPLICATE_ACCOUNT = 10005; // User duplicate account insertion
ERR_USER_ALLOWED_ACCOUNT = 10006; // User does not have permission for the account
ERR_INVALID_ADMIN_LEVEL = 10007; // Invalid permission level
ERR_USER_ACCOUNT_MISMATCH = 10008; // User does not belong to the account
ERR_NO_ACCOUNT_SPECIFIED = 10009;

ERR_INVALID_ACCOUNT = 10010; // Invalid account
ERR_DUPLICATE_ACCOUNT = 10011; // Duplicate account insertion
ERR_INVALID_PARENTACCOUNT = 10012; // Invalid parent account
ERR_DELETE_ACCOUNT = 10013; // Account has child nodes

ERR_INVALID_PARTITION = 10014; // Invalid partition, partition does not exist
ERR_ALLOWED_PARTITION = 10015; // Account/user does not include this partition
ERR_DUPLICATE_PARTITION = 10016; // Account/user duplicate insertion
ERR_PARENT_ALLOWED_PARTITION = 10017; // Parent account does not include this partition
ERR_USER_EMPTY_PARTITION = 10018; // Cannot add QoS when user has no partition
ERR_CHILD_HAS_PARTITION = 10019; // Partition '{}' is used by some descendant node of the account '{}'. Ignoring this constraint with forced operation.

ERR_INVALID_QOS = 10020; // Invalid QoS, QoS does not exist
ERR_DB_DUPLICATE_QOS = 10021; // Duplicate QoS insertion in the database.
ERR_DELETE_QOS = 10022; // QoS reference count is not zero.
ERR_CONVERT_TO_INTERGER = 10023; // String to integer conversion failed
ERR_TIME_LIMIT = 10024; // Invalid time value
ERR_ALLOWED_QOS = 10025; // Account/user does not include this QoS.
ERR_DUPLICATE_QOS = 10026; // Account/user duplicate insertion.
ERR_PARENT_ALLOWED_QOS = 10027; // Parent account does not include this QoS.
ERR_SET_ALLOWED_QOS = 10028; // QoS '{}' is the default QoS of partition '{}', but not found in the new QoS list.
ERR_ALLOWED_DEFAULT_QOS = 10029; // Default QoS is not in the allowed QoS list
ERR_DUPLICATE_DEFAULT_QOS = 10030; // Duplicate default QoS setting
ERR_CHILD_HAS_DEFAULT_QOS = 10031; // Someone is using QoS '{}' as default QoS. Ignoring this constraint with forced deletion, the deleted default QoS is randomly replaced with one of the remaining items in the QoS list.
ERR_SET_ACCOUNT_QOS = 10032; // QoS '{}' is used by some descendant node or itself of the account '{}'. Ignoring this constraint with forced operation.
ERR_SET_DEFAULT_QOS = 10033; // Qos '{}' not in allowed qos list or is already the default qos
ERR_IS_DEFAULT_QOS = 10034;

ERR_UPDATE_DATABASE = 10035; // Database update failed

ERR_GENERIC_FAILURE = 10100;
ERR_NO_RESOURCE = 10101;
ERR_NON_EXISTENT = 10102;
ERR_INVALID_NODE_NUM = 10103;
ERR_SYSTEM_ERR = 10104;
ERR_EXISTING_TASK = 10105;
ERR_INVALID_PARAM = 10106;
ERR_STOP = 10107;
ERR_PERMISSION_DENIED = 10108;
ERR_CONNECTION_TIMEOUT = 10109;
ERR_CONNECTION_ABORTED = 10110;
ERR_RPC_FAILURE = 10111;
ERR_TOKEN_REQUEST_FAILURE = 10112;
ERR_STREAM_BROKEN = 10113;
ERR_INVALID_STUB = 10114;
ERR_CGROUP = 10115;
ERR_PROTOBUF = 10116;
ERR_LIB_EVENT = 10117;
ERR_NO_AVAIL_NODE = 10118;
ERR_INVALID_UID = 1; // Invalid UID passed
ERR_INVALID_OP_USER = 2; // Invalid operation user
ERR_INVALID_USER = 3; // Invalid user
ERR_PERMISSION_USER = 4; // User permissions too low, no permission to operate
ERR_BLOCKED_USER = 5;
ERR_USER_DUPLICATE_ACCOUNT= 6; // User duplicate account insertion
ERR_USER_ALLOWED_ACCOUNT = 7; // User does not have permission for the account
ERR_INVALID_ADMIN_LEVEL = 8; // Invalid permission level
ERR_USER_ACCOUNT_MISMATCH = 9; // User does not belong to the account
ERR_NO_ACCOUNT_SPECIFIED = 10;

ERR_INVALID_ACCOUNT = 11; // Invalid account
ERR_DUPLICATE_ACCOUNT = 12; // Duplicate account insertion
ERR_INVALID_PARENTACCOUNT = 13; // Invalid parent account
ERR_DELETE_ACCOUNT = 14; // Account has child nodes
ERR_BLOCKED_ACCOUNT = 15;

ERR_INVALID_PARTITION = 16; // Invalid partition, partition does not exist
ERR_ALLOWED_PARTITION = 17; // Account/user does not include this partition
ERR_DUPLICATE_PARTITION = 18; // Account/user duplicate insertion
ERR_PARENT_ALLOWED_PARTITION = 19; // Parent account does not include this partition
ERR_USER_EMPTY_PARTITION = 20; // Cannot add QoS when user has no partition
ERR_CHILD_HAS_PARTITION = 21; // Partition '{}' is used by some descendant node of the account '{}'. Ignoring this constraint with forced operation.
ERR_HAS_NO_QOS_IN_PARTITION = 22;
ERR_HAS_ALLOWED_QOS_IN_PARTITION = 23;

ERR_INVALID_QOS = 24; // Invalid QoS, QoS does not exist
ERR_DB_DUPLICATE_QOS = 25; // Duplicate QoS insertion in the database.
ERR_DELETE_QOS = 26; // QoS reference count is not zero.
ERR_CONVERT_TO_INTERGER = 27; // String to integer conversion failed
ERR_TIME_LIMIT = 28; // Invalid time value
ERR_ALLOWED_QOS = 29; // Account/user does not include this QoS.
ERR_DUPLICATE_QOS = 30; // Account/user duplicate insertion.
ERR_PARENT_ALLOWED_QOS = 31; // Parent account does not include this QoS.
ERR_SET_ALLOWED_QOS = 32; // QoS '{}' is the default QoS of partition '{}', but not found in the new QoS list.
ERR_ALLOWED_DEFAULT_QOS = 33; // Default QoS is not in the allowed QoS list
ERR_DUPLICATE_DEFAULT_QOS = 34; // Duplicate default QoS setting
ERR_CHILD_HAS_DEFAULT_QOS = 35; // Someone is using QoS '{}' as default QoS. Ignoring this constraint with forced deletion, the deleted default QoS is randomly replaced with one of the remaining items in the QoS list.
ERR_SET_ACCOUNT_QOS = 36; // QoS '{}' is used by some descendant node or itself of the account '{}'. Ignoring this constraint with forced operation.
ERR_SET_DEFAULT_QOS = 37; // Qos '{}' not in allowed qos list or is already the default qos
ERR_IS_DEFAULT_QOS = 38;

ERR_UPDATE_DATABASE = 39; // Database update failed

ERR_GENERIC_FAILURE = 40;
ERR_NO_RESOURCE = 41;
ERR_NON_EXISTENT = 42;
ERR_INVALID_NODE_NUM = 43;
ERR_INVAILD_NODE_LIST = 44;
ERR_INVAILD_EX_NODE_LIST = 45;
ERR_TIME_TIMIT_BEYOND = 46;
ERR_CPUS_PER_TASK_BEYOND = 47;
ERR_NO_ENOUGH_NODE = 48;

ERR_SYSTEM_ERR = 49;
ERR_EXISTING_TASK = 50;
ERR_BEYOND_TASK_ID = 51;
ERR_INVALID_PARAM = 52;
ERR_STOP = 53;
ERR_PERMISSION_DENIED = 54;
ERR_CONNECTION_TIMEOUT = 55;
ERR_CONNECTION_ABORTED = 56;
ERR_RPC_FAILURE = 57;
ERR_TOKEN_REQUEST_FAILURE = 58;
ERR_STREAM_BROKEN = 59;
ERR_INVALID_STUB = 60;
ERR_CGROUP = 61;
ERR_PROTOBUF = 62;
ERR_LIB_EVENT = 63;
ERR_NO_AVAIL_NODE = 64;
ERR_CODE_COUNT = 65;
}

enum EntityType {
Expand Down
Loading
Loading