-
Notifications
You must be signed in to change notification settings - Fork 11
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
initial cut at thread throttling / memory management #2
Conversation
galenatjpl
commented
Dec 2, 2020
- added basic SQS thread throttling
- cleanup of AWS client resources
- bumped AWS SDK library version to near latest
* cleanup of AWS client resources * bumped AWS SDK library version to near latest
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.
Great work @galenatjpl! Looks good to me, I only have a few minor changes.
@@ -26,25 +26,30 @@ | |||
* @author ghollins, jwood, ztaylor | |||
*/ | |||
public class S3DataManager { |
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.
public class S3DataManager { | |
public class S3DataManager implements AutoClosable { |
I'd suggest we instead make this class AutoClosable, so that it'll get cleaned up even in sneaky places we don't expect. It also allows us to use the try with resources paradigm instead of try...finally
.
|
||
public void close() { |
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.
public void close() { | |
@Override | |
public void close() throws Exception { |
Add override annotation for AutoClosable interface
@@ -406,46 +406,49 @@ private void scheduleIfNotAlready(String initiationTrigger, Map<String,String> p | |||
protected synchronized boolean skipScheduling(Map<String,String> partners) { | |||
S3DataManager s3 = new S3DataManager(aws_default_region); |
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.
S3DataManager s3 = new S3DataManager(aws_default_region); |
Define below in try with resources
block
finally { | ||
s3.close(); | ||
} |
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.
finally { | |
s3.close(); | |
} |
s3
will be automatically cleaned up by the try with resources
block
Hi @ztaylor54, I've implemented the above recommended changes by you. Please take a look. |
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.
Looks great, thanks @galenatjpl!
* Add error handling if mimetype is not set. * Add column for "edit" and "delete" buttons * Change "Delete" to "Stop Running" * Update Output Table. Move to top table. * Add warning for output vars, move style into css * Implement output_display_order support * Don't display output_display_order * Update processes page to consider order output var * Add test model * Update logs css * Add model * Update test * Move model to correct folder