I'm using the gremlin javascript client (3.4.2) to query a janusgraph through gremlin server. I noticed that after having the server running for a while while developing, some of the requests that query the graph start to stay on pending for a lot (the amount of timeout that is set on gremlin-server).
Looking at the server console I can see this message:
Pausing response writing as writeBufferHighWaterMark exceeded on RequestMessage{, requestId=9697c61a-34de-4764-a8c4-72d7f7a154ac, op='bytecode', processor='traversal', args={gremlin=[[], [V(), has(User, identityid, NQ05cGsB3uhLm-BIAGPq), outE(worked), choose([[], [values(dateto)]], [[], [project(vertexId, role, businessId, business, relationId, dateinsert, datefrom, dateto), by([[], [inV(), hasLabel(Job), id()]]), by([[], [inV(), hasLabel(Job), values(role)]]), by([[], [inV(), hasLabel(Job), outE(), hasLabel(at), inV(), id()]]), by([[], [inV(), hasLabel(Job), outE(), hasLabel(at), inV(), values(name)]]), by(id), by(dateinsert), by(datefrom), by(dateto)]], [[], [project(vertexId, role, businessId, business, relationId, dateinsert, datefrom), by([[], [inV(), hasLabel(Job), id()]]), by([[], [inV(), hasLabel(Job), values(role)]]), by([[], [inV(), hasLabel(Job), outE(), hasLabel(at), inV(), id()]]), by([[], [inV(), hasLabel(Job), outE(), hasLabel(at), inV(), values(name)]]), by(id), by(dateinsert), by(datefrom)]])]], aliases={g=refeenet}}} - writing will continue once client has caught up
And then after a while appears the timeout WARNING.
I'm not sure why this happens and I didn't find anything usefull looking for a solution.
I'm using typescript.
This is the class that manages the traversal source:
import gremlin from "gremlin";
const GREMLIN_URL = "ws://localhost:8182/gremlin";
const GRAPH_NAME = "maingraph";
const { Graph } = gremlin.structure;
const { DriverRemoteConnection } = gremlin.driver;
export class GremlinApi {
public static g: gremlin.process.GraphTraversalSource;
public static connection: gremlin.driver.DriverRemoteConnection;
public static getTraversalSource() {
if (!GremlinApi.g) {
const graph = new Graph();
GremlinApi.connection = new DriverRemoteConnection(GREMLIN_URL, { traversalSource: GRAPH_NAME });
GremlinApi.g = graph.traversal().withRemote(GremlinApi.connection);
}
return GremlinApi.g;
}
public static closeTraversal() {
if (GremlinApi.connection && GremlinApi.connection.close) {
GremlinApi.connection.close();
GremlinApi.connection = null;
GremlinApi.g = null;
}
}
}
And this is an example of how I usually use the traversal:
import { GremlinApi } from "../db/gremlinApi/gremlinApi";
// Get the traversal
const g = GremlinApi.getTraversalSource();
// Do something with the traversal
GremlinApi.closeTraversal();
This usually happens there are something like 3/4 queries really close to each other. Some of those goes in timeout.
Any idea on what could be causing this problem?