mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
fix(NA): apply ipv4 first dns result order for worker threads (#163484)
This PR is a follow up of https://github.com/elastic/kibana/pull/163025 as we discover the initial fix doesn't apply correctly to working threads during development.
This commit is contained in:
parent
49849cf42c
commit
f4856f7478
2 changed files with 14 additions and 1 deletions
13
src/setup_node_env/dns_ipv4_first.js
Normal file
13
src/setup_node_env/dns_ipv4_first.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// enables Node 16 default DNS lookup behavior for the current thread
|
||||
require('dns').setDefaultResultOrder('ipv4first');
|
||||
|
||||
// overrides current process node options, so it can be restored in worker threads too
|
||||
process.env.NODE_OPTIONS = `${process.env.NODE_OPTIONS || ''} --dns-result-order=ipv4first`;
|
|
@ -10,7 +10,7 @@
|
|||
require('./setup_env');
|
||||
|
||||
// restore < Node 16 default DNS lookup behavior
|
||||
require('dns').setDefaultResultOrder('ipv4first');
|
||||
require('./dns_ipv4_first');
|
||||
|
||||
require('@kbn/babel-register').install();
|
||||
require('./polyfill');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue