obscure File_system::Out_of_node_handles exception

Replace the Out_of_node_handles exception with Out_of_metadata.
Clients need to know when the server is out of internal resources,
but not why.

Cleanup and sort the errors at file_system_session.h.
Remove 'Size_limit_reached exception' from File_system, which was
internal to ram_fs.

Issue #1751
Fixes #1909
This commit is contained in:
Emery Hemingway
2016-03-17 15:09:07 +01:00
committed by Christian Helmuth
parent 58632ab8b5
commit cb952d2087
14 changed files with 109 additions and 95 deletions

View File

@ -167,8 +167,8 @@ class Fs_log::Root_component :
} catch (No_space) {
PERR("file system out of space");
} catch (Out_of_node_handles) {
PERR("too many open file handles");
} catch (Out_of_metadata) {
PERR("file system server out of metadata");
} catch (Invalid_name) {
PERR("%s: invalid path", Path(file_name, dir_path).base());

View File

@ -97,7 +97,6 @@ class File_system::Session_component : public Session_rpc_object
_process_packet_op(packet, *node);
}
catch (Invalid_handle) { PERR("Invalid_handle"); }
catch (Size_limit_reached) { PERR("Size_limit_reached"); }
/*
* The 'acknowledge_packet' function cannot block because we

View File

@ -95,7 +95,6 @@ namespace File_system {
_process_packet_op(packet, *node);
}
catch (Invalid_handle) { PERR("Invalid_handle"); }
catch (Size_limit_reached) { PERR("Size_limit_reached"); }
/*
* The 'acknowledge_packet' function cannot block because we

View File

@ -107,7 +107,6 @@ namespace File_system {
_process_packet_op(packet, *node);
}
catch (Invalid_handle) { PERR("Invalid_handle"); }
catch (Size_limit_reached) { PERR("Size_limit_reached"); }
/*
* The 'acknowledge_packet' function cannot block because we

View File

@ -171,8 +171,10 @@ namespace File_system {
if (seek_offset == (seek_off_t)(~0))
seek_offset = _chunk.used_size();
if (seek_offset + len >= Chunk_level_0::SIZE)
throw Size_limit_reached();
if (seek_offset + len >= Chunk_level_0::SIZE) {
len = (Chunk_level_0::SIZE-1) - seek_offset;
PERR("%s: size limit %d reached", name(), Chunk_level_0::SIZE);
}
_chunk.write(src, len, (size_t)seek_offset);

View File

@ -700,7 +700,6 @@ class File_system::Session_component : public Session_rpc_object
_process_packet_op(packet, *node);
}
catch (Invalid_handle) { PERR("Invalid_handle"); }
catch (Size_limit_reached) { PERR("Size_limit_reached"); }
/*
* The 'acknowledge_packet' function cannot block because we

View File

@ -67,7 +67,7 @@ namespace File_system {
/**
* Allocate node handle
*
* \throw Out_of_node_handles
* \throw Out_of_metadata
*/
int _alloc(Node *node, Mode mode)
{
@ -80,7 +80,7 @@ namespace File_system {
return i;
}
throw Out_of_node_handles();
throw Out_of_metadata();
}
bool _in_range(int handle) const