Gradle task finishes incomplete (discontinues after 15 mins 34 secs)


We are running some gradle tasks and one of the task takes more than 16 minutes. In such cases, gradle do not wait for task to be completed in background (database inserts) and shows the message after 15 min 34 secs that task is completed. However, in actual, background task was not completed but gradle moves on to next task given.

Is there any timeout configuration for gradle task? what could be the possible cause and solution for this issue?


Gradle itself doesn’t have tasks that perform database inserts and wouldn’t arbitrarily background and detach from the action of a task after some amount of time. Either you’ve written code to do this or you’re using and configuring a plugin that has written code to do that. You haven’t provided any implementation details about the relevant parts of your build script though.

We have a task which invoke DB scripts to perform some inserts.

However, when there are inserts which goes on more than 16 minutes then gradle displays the task is finished and move on to next task but actually the task was not complete.

Its not about DB inserts, but about gradle not waiting after 15 min 34 secs.

Same thing happened when a gradle task of deploying a war discontinued after waiting for 15 min 34 sec for tomcat manager to be up.

Gradle itself is not just arbitrarily giving up on executing a task after 15 min 34 sec. If you’re seeing this consistently at this exact amount of time, something in your build or environment would be causing this specific behavior. A task will run indefinitely unless its implementation specifically does otherwise or something else interferes and there’s still not enough information here to guess what is occurring in your build (i.e. I can easily create a task that will run for far longer, even days).

1 Like

Thanks for the confirmation that its not from Gradle end.
We are now monitoring build and environment to find out the root cause.