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

Async Task Out of Memory Hangs Application without OOME #42

Open
2 of 4 tasks
jobeninc opened this issue Mar 25, 2023 · 0 comments
Open
2 of 4 tasks

Async Task Out of Memory Hangs Application without OOME #42

jobeninc opened this issue Mar 25, 2023 · 0 comments

Comments

@jobeninc
Copy link

jobeninc commented Mar 25, 2023

Task List

  • Steps to reproduce provided
  • Stacktrace: N/A
  • Example that reproduces the problem uploaded to Github: N/A
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create new Grails Web Application

    • Reduce build.gradle memory usage to a reasonably small value -Xmx512m
  2. Insert an async task into the default controller

Promise promise = task {
   try {
        //Insert High Memory Usage Task
   } catch (Exception e)  {
        log.error("Exceptions does not occur here", e)
   } finally {
        //Code here does not process
   }
}
promise.onError { Exception e ->
    log.error("OOME exceptions should at least occur here, but do not", e)
}
  1. Insert High Memory Usage Task in the above comment
  • I am using a JSONSluper to read a huge JSON file and then try to write it back out to a file.
  • File must be large enough to cause an Out Of Memory Exception (OOME) if run outside of the async task
  1. Run grails run-app in your dev environment or go big and make a production environment and run the war file.

  2. Execute the task in the controller

  3. Wait for OOME, get coffee, watch movie, drink beer, concur that an OOME should occur

Expected Behaviour

An OOME Exception should occur and the task should stop processing

Actual Behaviour

The task runs indefinitely and my laptop gets hot enough to grill a hamburger

Environment Information

  • Operating System: Mac OS (Dev environment) - (Also Tested on CentOS 7 - Prod environment)
  • Grails Version: 5.2.5
  • JDK Version: Open JDK (Build 1.8.0_275-b01)
  • Container Version (If Applicable): Dev environment or Tomcat 9.0.71

Example Application

  • See simple instructions above to reproduce in any Grails application you currently have setup.
  • Github project is unnecessary

Thanks!

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

No branches or pull requests

1 participant