Story #6494
Remove local caching of inputstreams from v1 API method implementations
100%
Description
buffering input streams into byte arrays to close remote input streams creates an unmanaged situation where a large data object can cause out-of-memory / heap errors. This is bad because application developers who use libclient have to pass on this weakness to their customers.
The solution is to avoid buffering, but also wrap the inputstream with AutoClosingInputStream to prevent accidental input streams being left open and tying up connections.
The buffering LocalCache imposes is potentially dangerous as well and needs a workaround, both for v1.x and v2.x.
Subtasks
Related issues
History
#1 Updated by Rob Nahf about 10 years ago
- translation missing: en.field_remaining_hours set to 4.0
- Estimated time set to 4.00
probably want to test AutoCloseInputStream behavior
#2 Updated by Rob Nahf about 10 years ago
- Subject changed from confirm that libclient methods don't localize input streams except in LocalCache. to Remove local caching of inputstreams from v1 API method implementations
- Parent task deleted (
#3369) - Category set to d1_libclient_java
(also implement in v2)
#3 Updated by Rob Nahf about 10 years ago
- Due date set to 2014-10-17
- translation missing: en.field_remaining_hours changed from 4.0 to 0.0
- Tracker changed from Task to Story
this constitutes a behavior change, so should be part of the next minor release.
#4 Updated by Rob Nahf about 10 years ago
- Target version changed from CCI-1.4.1 to CCI-1.5.0
- Due date changed from 2014-10-17 to 2014-10-02
#5 Updated by Rob Nahf about 10 years ago
- Product Version changed from * to 1.4.0
- Due date changed from 2014-10-02 to 2014-10-20
#6 Updated by Rob Nahf about 10 years ago
- Target version changed from CCI-1.5.0 to CCI-1.5.1
#7 Updated by Rob Nahf about 10 years ago
- Due date changed from 2014-10-20 to 2014-11-04
- Target version changed from CCI-1.5.1 to CCI-1.5.0
#8 Updated by Rob Nahf about 10 years ago
- Status changed from New to In Progress
- Due date changed from 2014-11-04 to 2014-11-10
- Description updated (diff)
removed input stream buffering into bytearrays for d1node.get() and d1node.query() methods - the two that return a bare input stream. d1Node.get() has a LocalCache implementation that also buffers the content into byte[], so I placed a size limit on caching so that the item isn't cached if it is over a certain size. This isn't the optimal solution, but is a workaround for the unmanaged out-of-memory exception.
#9 Updated by Rob Nahf about 10 years ago
- Description updated (diff)
- % Done changed from 0 to 50
#10 Updated by Rob Nahf about 10 years ago
- Status changed from In Progress to Testing
- Due date changed from 2014-11-11 to 2014-11-12
#11 Updated by Rob Nahf almost 10 years ago
- Status changed from Testing to Closed
- Product Version changed from 1.4.0 to 1.3.1
- Due date changed from 2014-11-25 to 2014-12-15
no issues encountered in beta and stage testing of CN-1.5.0.