0

We are creating file processing service using spring boot. We are getting XML file as Clob from DB and converting it to String( We will then unmarshall String to JAXBElement for processing).

Since it is file processing service our design for this service to run as PCF Task application so that when app completes processing the file, it will terminate and free up cloud resource(RAM,Disk).

When we are processing small files(tried till 60MB) with PCF task application we have no issues. But when we are trying to process 150 MB file,Task application instance is terminating without any error log.

We deployed same application as PCF web application instance and used REST API to process the file. Then we are able to process the file.

Task App Configuration :

We have started with 1GB RAM Memeory and 1GB Disk space for a Task instance and Increased RAM Memory till 5GB and 2GB Disk space still App is not able to process the file.

Web App Configuration:

With 2Gb RAM and 1GB Disk space. With REST API to start file processing we are able to process the file.

Why is this difference?

Code Snippet:

if (clob != null) {

  BufferedReader reader = new BufferedReader(new InputStreamReader(clob.getAsciiStream()));

  String read = null;

  StringBuffer sb = new StringBuffer();

   LOGGER.info("Before While Loop");

   while ((read = reader.readLine()) != null) {

  sb.append(read);

  }

   LOGGER.info("After While Loop");

  String xml = sb.toString();

}

PCF Task App Log:

2020-04-02T15:54:19.787+05:30 [APP/TASK/Bulk File/0] [OUT] 2020-04-02 10:24:19.786 INFO 15 --- [ main] c.f.g.s.s.impl.ServiceImpl : Before While Loop

2020-04-02T15:54:29.180+05:30 [APP/TASK/Bulk File/0] [OUT] 2020-04-02 10:24:29.180 INFO 15 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...

2020-04-02T15:54:29.220+05:30 [APP/TASK/Bulk File/0] [OUT] 2020-04-02 10:24:29.220 INFO 15 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.

2020-04-02T15:54:29.490+05:30 [APP/TASK/Bulk File/0] [OUT] Exit status 1

2020-04-02T15:54:29.630+05:30 [CELL/0] [OUT] Cell 17fd36a9-3f6b-4957-89b5-83639048dadf stopping instance 204e6fc5-6998-47d3-89dc-59ac702caccd

2020-04-02T15:54:29.630+05:30 [CELL/0] [OUT] Cell 17fd36a9-3f6b-4957-89b5-83639048dadf destroying container for instance 204e6fc5-6998-47d3-89dc-59ac702caccd
  • 1
    Can you post the whole code of your app, which is deployed (the smallest possible code to reproduce)? What does your cf tasks command look like to start the task? What does cf events say? What could the exit status 1 of your app mean? Does it work locally? – Florian Apr 02 '20 at 16:45
  • 1
    Exit status 1 means your app isn't exiting cleanly. It also appears to be shutting down on it's own, because the two lines you shared there are Hikari cleaning up before the app terminates. That rules out exceeding your memory limit. If you did that, you'd get a different exit code and there would be no clean up. – Daniel Mikusa Apr 03 '20 at 13:24
  • 3
    The main difference between running as a web app and as a task is that the Java buildpack sets the start command for your web app, but it can't for a task. You have to manually specify the task to run. It's important to share what you're using for the task command. Usually what you'd do is take the web start command and just modify the minimal set of parameters to run your task. This makes sure you have configured the JVM correctly. – Daniel Mikusa Apr 03 '20 at 13:26
  • Thanks @DanielMikusa – Daniel Devadoss Apr 06 '20 at 15:04

0 Answers0