Skip to content
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

Merged
merged 3 commits into from
Dec 16, 2020

Conversation

galenatjpl
Copy link
Contributor

  • 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
Copy link
Collaborator

@ztaylor54 ztaylor54 left a 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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
S3DataManager s3 = new S3DataManager(aws_default_region);

Define below in try with resources block

Comment on lines 450 to 452
finally {
s3.close();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
finally {
s3.close();
}

s3 will be automatically cleaned up by the try with resources block

@galenatjpl
Copy link
Contributor Author

Hi @ztaylor54, I've implemented the above recommended changes by you. Please take a look.

Copy link
Collaborator

@ztaylor54 ztaylor54 left a 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!

@ztaylor54 ztaylor54 merged commit 1fd6f92 into main Dec 16, 2020
@ztaylor54 ztaylor54 deleted the 1-memory-leak-and-sqs-throttling branch December 16, 2020 20:04
jamesfwood pushed a commit that referenced this pull request Aug 3, 2023
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory Leak Associated with Quick Run-up of threads and/or AWS Client Resource Management
3 participants