Java-client-lib-2.1.0 for influxdb-v2 .0.4 failed deleting measurement

I can’t remove measurement with java client v2 and can do it with client v1.
This measurement contains 1 year of daily candlesticks for ~10K stocks (~300M data).
My code

OkHttpClient.Builder builder = new OkHttpClient.Builder().readTimeout(45, TimeUnit.SECONDS)
.writeTimeout(45, TimeUnit.SECONDS).connectTimeout(45, TimeUnit.SECONDS);

public void dropMeasurement(String bucketName, String measurement, String org)
	DeleteApi deleteApi = influxDBClient.getDeleteApi();
	OffsetDateTime start =, ChronoUnit.DAYS);
	OffsetDateTime stop =;
	DeletePredicateRequest pr = new DeletePredicateRequest();
	String prd = "\"_measurement\"=\"" + measurement + "\"";
	System.out.println("remove: " + prd);
		deleteApi.delete(pr, bucketName, org);
	} catch (InfluxException ie)
		System.out.println("InfluxException => " + ie);

remove: “_measurement”=“historyday”

Apr 26, 2021 10:05:30 PM okhttp3.internal.platform.Platform log
INFO: ← HTTP FAILED: timeout
InfluxException => com.influxdb.exceptions.InfluxException: timeout

Client for influxdb-v1.8 does it, no problems.
Please give your thoughts.
Thank you

Hi @mitalpha,

the timeout exception is from a server side. Please try to increase timeout:

OkHttpClient.Builder okHttpClient = new OkHttpClient.Builder()
        .readTimeout(1, TimeUnit.MINUTES)
        .writeTimeout(1, TimeUnit.MINUTES)
        .connectTimeout(1, TimeUnit.MINUTES);

InfluxDBClientOptions options = InfluxDBClientOptions

InfluxDBClient client = InfluxDBClientFactory.create(options);


Changed timeout value to 1800, result is the same.
OkHttpClient.Builder builder = new OkHttpClient.Builder().readTimeout(1800, TimeUnit.SECONDS).writeTimeout(1800, TimeUnit.SECONDS).connectTimeout(1800, TimeUnit.SECONDS);
For several candlesticks it works, but for large size of measurements doesn’t.
It seems like on server side thread pool is chocking…
With v.1.8 removing the same size of measurement takes ~15-20sec.
Thank you for response