Execute resource does not wait when chef-client runs in background

Hi all,

I am facing very strange issue.
I have configured chef-client to run periodically after 2 mins. and I have a batch file which internally calls main java class.
I created a recipe and added following code :
execute ‘name’ do
command ‘batch file path’
not_if {::Dir.exist?(’<dir_path>’)}
end
If i run chef-client manually on client machine then it waits for java class to finish but
when it run in background after every 2 mins it does not wait for the java class to complete.
In this case chef-client command gets finish but class still getting executed in background.
This is causing problem to me because I have created multiple threads in java class and I am not able to track what 's exactly happening

Can anyone help on this?
Is this something working as designed or am I doing anything wrong ?
Any help is appreciated.