Skip to content

Commit

Permalink
Elasticsearch requestTimeout
Browse files Browse the repository at this point in the history
Fixes #6377
  • Loading branch information
u1473499 authored and w33ble committed Mar 2, 2016
1 parent b968cc9 commit 5776eec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/plugins/elasticsearch/lib/create_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ function createProxy(server, method, route, config) {
mapUri: mapUri(server),
passThrough: true,
agent: createAgent(server),
xforward: true
xforward: true,
timeout: server.config().get('elasticsearch.requestTimeout') + 100
}
},
};
Expand Down
1 change: 1 addition & 0 deletions src/server/KbnServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = class KbnServer {
() => {
if (this.config.get('server.autoListen')) {
this.ready = constant(resolve());
this.server.listener.timeout = this.config.get('elasticsearch.requestTimeout') + 100;
return this.listen();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module.exports = async (kbnServer, server, config) => {
defaultInjectedVars.kbnIndex = config.get('kibana.index');
}
if (config.has('elasticsearch')) {
defaultInjectedVars.esRequestTimeout = config.get('elasticsearch.requestTimeout');
defaultInjectedVars.esShardTimeout = config.get('elasticsearch.shardTimeout');
defaultInjectedVars.esApiVersion = config.get('elasticsearch.apiVersion');
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ define(function (require) {
var es; // share the client amoungst all apps
require('ui/modules')
.get('kibana', ['elasticsearch', 'kibana/config'])
.service('es', function (esFactory, esUrl, $q, esApiVersion) {
.service('es', function (esFactory, esUrl, $q, esApiVersion, esRequestTimeout) {
if (es) return es;

es = esFactory({
host: esUrl,
log: 'info',
requestTimeout: 0,
requestTimeout: esRequestTimeout,
apiVersion: esApiVersion,
plugins: [function (Client, config) {

Expand Down

0 comments on commit 5776eec

Please sign in to comment.