[pve-devel] Plugin to add support for native ZFS on shared storage

mir at datanom.net mir at datanom.net
Mon Aug 12 20:12:48 CEST 2013


This newest version fixes a serious bug cause my asynchronious AJAX calls from
web gui.

The problem displays its ugly face when the content tab is invoked in the gui.
This request calls to plugin method 'list_images' which will produce a list of
all images available on the storage server. After the gui receives this list it
will call the plugins method 'path' on every image in the list, each call
requires two ssh requests to the storage server and since each path call is
made asynchronious a race condition is likely to happening if only a few
images is found on the storage causing the receive buffer on the node being
mangled with responses from numerous ssh calls. This means that the receive
buffer growing faster than the the gui is able to consume causing AJAX calls
to be terminated by the default timeout - eg. the gui gives up and shows 
'communication error' to the user.

To prevent this I have refactored the code handling 'list_images' so that all
needed information is collected by the first call and at the same time this
information is cached in the plugin to elimate further calls to the storage.
Apart from solving the nasty bug the refactored code also has improved
performance of 'list_images' with a factor 10;-)




More information about the pve-devel mailing list