Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix default timeouts and ignored requestTimeout #6341

Closed
wants to merge 10 commits into from
Closed

fix default timeouts and ignored requestTimeout #6341

wants to merge 10 commits into from

Conversation

ich199
Copy link

@ich199 ich199 commented Feb 26, 2016

A couple of default NodeJS and HAPI timeouts were causing errors on long running Elasticsearch queries > 120 seconds.

Closes #6331

@elasticsearch-release
Copy link

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'.

@epixa
Copy link
Contributor

epixa commented Feb 26, 2016

@ich199 Can you issue a PR with these changes against master? We apply changes to master and then "backport" them to previous version feature branches. If this were to only be merged into 4.x, then it will simply regress when we release 5.0.

@epixa
Copy link
Contributor

epixa commented Feb 26, 2016

jenkins, test it

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for adding another 100ms to the configured timeout value?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had put this in to prevent a race condition and allow the web es client (https://github.com/ich199/kibana/blob/4.x/src/ui/public/es.js) to return/display the correct requestTimeout error before the socket was closed by the Kibana server process. Whether it is actually needed, I'm not sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The race condition is a valid concern, but honestly, if the request is timing out, I think we should just let it time out and leave it at that. Added any amount of time padding there, there's still no guarantee we're going to see an error, it could still just timeout.

@w33ble
Copy link
Contributor

w33ble commented Feb 27, 2016

@ich199 I set up a proxy to inject huge delays in requests to ES, and ran in to another problem with the health check. I opened a PR against your branch: https://github.com/ich199/kibana/pull/1

screenshot 2016-02-26 17 11 51

Over 3 minutes to load Discover since it's a 30s wait for every request, but it worked when I bumped the requestTimeout value up to 40000. With the changes in that PR, and pending the couple of questions I had on this one, I think this looks good.

I also noticed that there are a ton of merge conflicts against master. Don't worry about opening a new PR, I'll fix master by hand once this is merged. Fortunately, the changes are pretty small.

@w33ble
Copy link
Contributor

w33ble commented Feb 27, 2016

I guess I spoke a bit too soon. Seems the node socket timeout is still an issue once you cross the 2 minute mark.

This PR sets the time on h2o2, which doesn't affect the socket timeout, which defaults to 2 minutes. The request options you linked to originally seems to be the answer, but they don't seem to actually do anything - maybe I'm using it wrong though...

Once I get this sorted, I'll probably append the fix to that PR I opened against your branch.

screenshot 2016-02-26 17 58 49

@ich199
Copy link
Author

ich199 commented Feb 27, 2016

In my initial testing I hard coded a timeout value in the connectionOptions object in https://github.com/ich199/kibana/blob/4.x/src/server/http/index.js which definitely didn't error after 2 minutes and the expected results were returned after approx 3 minutes. e.g.
var connectionOptions = { host: config.get('server.host'), port: config.get('server.port'), state: { strictHeader: false }, routes: { cors: config.get('server.cors'), payload: { maxBytes: config.get('server.maxPayloadBytes') }, timeout: { socket: 300000 } } };

So, I think the route options do work. It's probably the way I have tried to set this value after the routes have been set up.

Unfortunately, I couldn't find a way of accessing the config.get('elasticsearch.RequestTimeout') value at this point as the Elasticsearch plugin is loaded at a later time. So, the line this.server.listener.timeout = this.config.get('elasticsearch.requestTimeout') in KbnServer.js in the commit ich199@86eb9d6?diff=unified should be setting the socket timeout, the same as the above timeout.socket parameter. However, I changed the location of setting this value in the commit ich199@a385245 Maybe this has stopped it working?

The other timeout being set, which you mentioned, is to fix the default 3 minute es h2o2 hapi proxy timeout, which I discovered on a long running query which took over 3 minutes to return results.

@w33ble
Copy link
Contributor

w33ble commented Feb 29, 2016

Yeah, the timeout: { socket: whatever } is the setting we want here, and we should be able to add that to the proxy route as well, if I understand the docs correctly. And I'm fairly confident I'm using it correctly with h2o2, since I was getting validation errors with some of the values I used.

Note that the connectionOptions you pointed to here don't apply to the proxy path though (the /elasticsearch route), just internal Kibana routes. So we don't want to use the elasticsearch.requestTimeout value here, unless both are being applied - I don't think that's the case, but I'll dig some more.

@w33ble
Copy link
Contributor

w33ble commented Feb 29, 2016

@ich199 I updated the PR with the socket timeout setting. With that, slow responses from Elasticsearch are now properly handled.

screenshot 2016-02-29 11 50 34

Take a look at the PR https://github.com/ich199/kibana/pull/1, merge it if it looks good to you and it'll show up in this PR.

After that, just need to address the + 100 timeout and requestTimeout default mentioned above. I'd like to see both reverted (and the yml file fixed) personally, but if you're dead-set on not doing that, I can reach out for a second opinion. I can also open another PR on your branch with the changes.

I think we can get this merged today.

@ich199
Copy link
Author

ich199 commented Mar 1, 2016

@w33ble that all looks good to me, I've merged those changes into my pr. I've just reverted the default and padding too. .

@epixa
Copy link
Contributor

epixa commented Mar 1, 2016

jenkins, test it

@w33ble
Copy link
Contributor

w33ble commented Mar 1, 2016

LGTM, thanks @ich199

I want to have @spalger take a quick look at this too, since some of these changes are mine and technically haven't been reviewed by anyone else internally yet. Once I get the go-ahead from him, I'll merge this and get the changes applied to master as well.

@w33ble w33ble assigned spalger and unassigned w33ble Mar 1, 2016
@@ -73,6 +73,7 @@ module.exports = class KbnServer {
let { server, config } = this;

await this.ready();
server.listener.timeout = config.get('elasticsearch.requestTimeout');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, this doesn't feel right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Primary issue is that this is using the elasticsearch plugins's config in KbnServer. Ideally, this would be something that happens at the route level, no? The elasticsearch plugin could define the timeout for the proxy route to match it's requestTimeout configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, looks like you're already doing that. Then you should just remove this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll take care of that.

@spalger spalger assigned w33ble and unassigned spalger Mar 1, 2016
@w33ble w33ble mentioned this pull request Mar 2, 2016
@w33ble
Copy link
Contributor

w33ble commented Mar 2, 2016

Since there were a couple more small changes needed, I opened #6377 to take care of them

Thanks again for the PR @ich199

@w33ble w33ble closed this Mar 2, 2016
w33ble added a commit to w33ble/kibana that referenced this pull request Mar 2, 2016
elasticsearch-bot pushed a commit that referenced this pull request Mar 2, 2016
jbudz pushed a commit that referenced this pull request Nov 18, 2022
## Summary
`eui@67.1.8` ⏩ `eui@70.2.2`

⚠️ Note: This upgrade contains breaking changes to `EuiFlexGroup` and
`EuiFlexGrid`, primarily around switching margins and negative margins
to `gap`. Please do a quick QA pass of your app to scan for any issues.
We're happy to help resolve minor fixes, or potentially follow up after
PR merges. You can find us over in #eui!

## [`70.2.4`](https://github.com/elastic/eui/tree/v70.2.4)

**Bug fixes**

- Fixed visual bug in nested `EuiFlexGroup`s, where the parent
`EuiFlexGroup` is responsive but a child `EuiFlexGroup` is not
([#6381](elastic/eui#6381))

## [`70.2.3`](https://github.com/elastic/eui/tree/v70.2.3)

**Bug fixes**

- Fixed incorrect margins in `EuiSuperDatePicker` caused by `EuiFlex`
CSS gap change ([#6380](elastic/eui#6380))

## [`70.2.2`](https://github.com/elastic/eui/tree/v70.2.2)

- `EuiButton` now accepts `minWidth={false}`
([#6373](elastic/eui#6373))

**Bug fixes**

- `EuiButton` no longer outputs unnecessary inline styles for
`minWidth={0}` or `minWidth={false}`
([#6373](elastic/eui#6373))
- `EuiFacetButton` no longer reports type issues when passing props
accepted by `EuiButton`
([#6373](elastic/eui#6373))
- Fixed the shadow sizes of `.eui-yScrollWithShadows` and
`.eui-xScrollWithShadows`
([#6374](elastic/eui#6374))


## [`70.2.1`](https://github.com/elastic/eui/tree/v70.2.1)

**Bug fixes**

- Re-fixed `EuiPageSection` not correctly merging `contentProps.css`
([#6365](elastic/eui#6365))
- Fixed `EuiTab` not defaulting to size `m`
([#6366](elastic/eui#6366))

## [`70.2.0`](https://github.com/elastic/eui/tree/v70.2.0)

- Added a keyboard shortcuts popover to `EuiDataGrid`'s toolbar. This
can be visually hidden via `toolbarVisibility.showKeyboardShortcuts`,
but will always remain accessible to keyboard and screen reader users.
([#6036](elastic/eui#6036))
- `EuiScreenReaderOnly`'s `showOnFocus` prop now also shows on focus
within its children ([#6036](elastic/eui#6036))
- Added `onFocus` prop callback to `EuiSuperDatePicker`
([#6320](elastic/eui#6320))

**Bug fixes**

- Fixed `EuiSelectable` to ensure the full options list is re-displayed
when the search bar is controlled and cleared using `searchProps.value`
([#6317](elastic/eui#6317))
- Fixed incorrect padding on `xl`-sized `EuiTabs`
([#6336](elastic/eui#6336))
- Fixed `EuiCard` not correctly merging `css` on its child `icon`s
([#6341](elastic/eui#6341))
- Fixed `EuiCheckableCard` not setting `css` on the correct DOM node
([#6341](elastic/eui#6341))
- Fixed a webkit rendering issue with `EuiModal`s containing
`EuiBasicTable`s tall enough to scroll
([#6343](elastic/eui#6343))
- Fixed bug in `to_initials` that truncates custom initials
([#6346](elastic/eui#6346))
- Fix bug in `EuiCard` where layout breaks when `horizontal` and
`selectable` are both passed
([#6348](elastic/eui#6348))

## [`70.1.0`](https://github.com/elastic/eui/tree/v70.1.0)

- Added the `hint` prop to the `<EuiSearchBar />`. This prop lets the
consumer render a hint below the search bar that will be displayed on
focus. ([#6319](elastic/eui#6319))
- Added the `hasDragDrop` prop to `EuiPopover`. Use this prop if your
popover contains `EuiDragDropContext`.
([#6329](elastic/eui#6329))

**Bug fixes**

- Fixed `EuiButton`'s cursor style when the button is disabled
([#6323](elastic/eui#6323))
- Fixed `EuiPageTemplate` not recognizing child
`EuiPageSidebar`s/`EuiPageTemplate.Sidebar`s with `css` props
([#6324](elastic/eui#6324))
- Fixed `EuiBetaBadge` to always respect its `anchorProps` values,
including when there is no tooltip content
([#6326](elastic/eui#6326))
- Temporarily patched `EuiModal` to not cause scroll-jumping issues on
modal open ([#6327](elastic/eui#6327))
- Fixed buggy drag & drop behavior within `EuiDataGrid`'s columns &
sorting toolbar popovers
([#6329](elastic/eui#6329))
- Fixed `EuiButton` not correctly passing `textProps` for children
inside fragments or i18n components
([#6332](elastic/eui#6332))
- Fixed `EuiButton` not correctly respecting `minWidth={0}`
([#6332](elastic/eui#6332))

**CSS-in-JS conversions**

- Converted `EuiTabs` to Emotion
([#6311](elastic/eui#6311))

## [`70.0.0`](https://github.com/elastic/eui/tree/v70.0.0)

- Added the `enabled` option to the `<EuiInMemoryTable />`
`executeQueryOptions` prop. This option prevents the Query from being
executed when controlled by the consumer.
([#6284](elastic/eui#6284))

**Bug fixes**

- Fixed `EuiOverlayMask` to set a
`[data-relative-to-header=above|below]` attribute to replace the
`--aboveHeader` and `--belowHeader` classNames removed in its Emotion
conversion ([#6289](elastic/eui#6289))
- Fixed `EuiHeader` CSS using removed `EuiOverlayMask` class modifiers
([#6293](elastic/eui#6293))
- Fixed `EuiToolTip` not respecting reduced motion preferences
([#6295](elastic/eui#6295))
- Fixed a bug with `EuiTour` where passing any `panelProps` would cause
the beacon to disappear
([#6298](elastic/eui#6298))

**Breaking changes**

- `@emotion/css` is now a required peer dependency, alongside
`@emotion/react` ([#6288](elastic/eui#6288))
- `@emotion/cache` is no longer required peer dependency, although your
project must still use it if setting custom cache/injection locations
([#6288](elastic/eui#6288))

**CSS-in-JS conversions**

- Converted `EuiCode` and `EuiCodeBlock` to Emotion; Removed
`euiCodeSyntaxTokens` Sass mixin and `$euiCodeBlockPaddingModifiers`;
([#6263](elastic/eui#6263))
- Converted `EuiResizableContainer` and `EuiResizablePanel` to Emotion
([#6287](elastic/eui#6287))

## [`69.0.0`](https://github.com/elastic/eui/tree/v69.0.0)

- Added support for `fullWidth` prop on EuiForm, which will be the
default for all rows/controls within
([#6229](elastic/eui#6229))
- Added support for `onResizeStart` and `onResizeEnd` callbacks to
`EuiResizableContainer`
([#6236](elastic/eui#6236))
- Added optional case sensitive option matching to `EuiComboBox` with
the `isCaseSensitive` prop
([#6268](elastic/eui#6268))
- `EuiFlexItem` now supports `grow={0}`
([#6270](elastic/eui#6270))
- Added the `alignItems` prop to `EuiFlexGrid`
([#6281](elastic/eui#6281))
- Added `filter`, `filterExclude`, `filterIgnore`, `filterInclude`,
`indexTemporary`, `infinity`, `sortAscending`, and `sortDescending`
glyphs to `EuiIcon` ([#6282](elastic/eui#6282))

**Bug fixes**

- Fixed `EuiTextProps` to show the `color` type option `inherit` as
default ([#6267](elastic/eui#6267))
- `EuiFlexGroup` now correctly respects `gutterSize` when responsive
([#6270](elastic/eui#6270))
- Fixed the last breadcrumb in `EuiBreadcrumbs`'s `breadcrumbs` array
not respecting `truncate` overrides
([#6280](elastic/eui#6280))

**Breaking changes**

- `EuiFlexGrid` no longer supports `columns={0}`. Use `EuiFlexGroup`
instead for normal flex display
([#6270](elastic/eui#6270))
- `EuiFlexGrid` now uses modern `display: grid` CSS
([#6270](elastic/eui#6270))
- `EuiFlexGroup`, `EuiFlexGrid`, and `EuiFlexItem` now use modern `gap`
CSS instead of margins and negative margins
([#6270](elastic/eui#6270))
- `EuiFlexGroup` no longer applies responsive styles to `column` or
`columnReverse` directions
([#6270](elastic/eui#6270))

**CSS-in-JS conversions**

- Converted `EuiFlexGroup`, `EuiFlexGrid`, and `EuiFlexItem` to Emotion
([#6270](elastic/eui#6270))

## [`68.0.0`](https://github.com/elastic/eui/tree/v68.0.0)

- Added `beta` glyph to `EuiIcon`
([#6250](elastic/eui#6250))
- Added `launch` and `spaces` glyphs to `EuiIcon`
([#6260](elastic/eui#6260))
- Added the `fallbackDestination` prop to `EuiSkipLink`, which accepts a
string of query selectors to fall back to if the `destinationId` does
not have a valid target. Defaults to `main`
([#6261](elastic/eui#6261))
- `EuiSkipLink` is now always an `a` tag to ensure that it is always
placed within screen reader link menus.
([#6261](elastic/eui#6261))

**Bug fixes**

- Fixed `EuiSuperDatePicker` not correctly merging passed `className`s
([#6253](elastic/eui#6253))
- Fixed `EuiColorStops` not correctly merging in passed
`data-test-subj`s, `style`s, or `...rest`
([#6255](elastic/eui#6255))
- Fixed `EuiResizablePanel` incorrectly passing `style` to the wrapper
instead of the panel. Use `wrapperProps.style` to pass styles to the
wrapper. ([#6255](elastic/eui#6255))
- Fixed custom `onClick`s passed to `EuiSkipLink` overriding
`overrideLinkBehavior`
([#6261](elastic/eui#6261))

**Breaking changes**

- Removed `inherit` and `ghost` color from `EuiListGroupItem`
([#6207](elastic/eui#6207))
- Changed default color to `text` instead of `inherit`
([#6207](elastic/eui#6207))

**CSS-in-JS conversions**

- Converted `EuiListGroup` and `EuiListGroupItem` to Emotion; Removed
`$euiListGroupGutterTypes`, `$euiListGroupItemColorTypes` and
`$euiListGroupItemSizeTypes`;
([#6207](elastic/eui#6207))
- Converted `EuiBadgeGroup` to Emotion
([#6258](elastic/eui#6258))
- Converted `EuiBetaBadge` to Emotion
([#6258](elastic/eui#6258))
- Converted `EuiNotificationBadge` to Emotion
([#6258](elastic/eui#6258))

Co-authored-by: Elizabet Oliveira <elizabet.oliveira@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants