OpenSearch/plugin
Jason Tedor 2bf8f4b0bc Remove print writer wrapping for users tools
When writing the users and users_roles files, we wrap a custom writer in
a print writer. There is a problem with this though: when print writer
closes it closes our underlying custom writer and the close
implementation for our custom writer is not trivial, it executes code
that can throw an I/O exception. When print writer invokes this close
and an I/O exception is thrown, it swallows that exception and sets the
status on the print writer to error. One would think that we could
simply check this status but alas print writer is broken here. The act
of checking the status causes print writer to try to flush the
underyling stream which is going to be completely undefined because the
underlying stream might or might not be closed. This might cause another
exception to be thrown, losing the original. Print writer screwed the
pooch here, there is no good reason to try to do any I/O after the
underlying writer entered a failed state. To address this we remove the
use of print writer, we use our custom writer directly. This allows any
thrown exceptions to bubble up.

Relates elastic/x-pack-elasticsearch#2288

Original commit: elastic/x-pack-elasticsearch@11b8dd5641
2017-08-16 12:50:39 -04:00
..
bin/x-pack Rename CONF_DIR to ES_PATH_CONF 2017-08-15 06:19:39 +09:00
bwc Remove assemble from build task when assemble removed 2017-06-16 17:19:47 -04:00
config/x-pack Rename core plugin and transport dirs 2017-02-10 11:02:42 -08:00
keys Rename core plugin and transport dirs 2017-02-10 11:02:42 -08:00
licenses Use shaded rest client dependencies 2017-07-24 12:56:17 -05:00
ml-cpp-snapshot [ML] Do not download the ml-cpp zip when building it locally (elastic/x-pack-elasticsearch#2262) 2017-08-15 16:31:23 +01:00
src Remove print writer wrapping for users tools 2017-08-16 12:50:39 -04:00
.gitignore Remove QueryParseContext (elastic/x-pack-elasticsearch#1895) 2017-07-03 17:31:18 +02:00
build.gradle Create security bootstrap checks early to access secure settings safely (elastic/x-pack-elasticsearch#2282) 2017-08-16 13:01:52 +02:00