-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-10777. S3 gateway error when parsing xml in concurrent execution #6609
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,19 +42,7 @@ | |
| public class MultiDeleteRequestUnmarshaller | ||
| implements MessageBodyReader<MultiDeleteRequest> { | ||
|
|
||
| private final JAXBContext context; | ||
| private final XMLReader xmlReader; | ||
|
|
||
| public MultiDeleteRequestUnmarshaller() { | ||
| try { | ||
| context = JAXBContext.newInstance(MultiDeleteRequest.class); | ||
| SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); | ||
| saxParserFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); | ||
| xmlReader = saxParserFactory.newSAXParser().getXMLReader(); | ||
| } catch (Exception ex) { | ||
| throw new AssertionError("Can't instantiate MultiDeleteRequest parser", | ||
| ex); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -68,6 +56,10 @@ public MultiDeleteRequest readFrom(Class<MultiDeleteRequest> type, | |
| Type genericType, Annotation[] annotations, MediaType mediaType, | ||
| MultivaluedMap<String, String> httpHeaders, InputStream entityStream) { | ||
| try { | ||
| JAXBContext context = JAXBContext.newInstance(MultiDeleteRequest.class); | ||
| SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); | ||
| saxParserFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); | ||
|
||
| XMLReader xmlReader = saxParserFactory.newSAXParser().getXMLReader(); | ||
| UnmarshallerHandler unmarshallerHandler = | ||
| context.createUnmarshaller().getUnmarshallerHandler(); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might also need to change for
PutBucketAclRequestUnmarshallersince it has a similar pattern (although not used as often).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure.