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

SQL: Adjust JDBC docs to use milliseconds for timeouts #79628

Merged
merged 2 commits into from
Oct 26, 2021

Conversation

Luegg
Copy link
Contributor

@Luegg Luegg commented Oct 21, 2021

Resolves #79480

My initial thought was to change the properties to be interpreted as seconds but this might not be worth it. All relevant places in the code seem to assume the timeouts to be in ms and there does not seem to be a consistent use of ms or s across JDBC drivers (Postgres uses seconds, MySQL uses ms, MS SQL mixes the two depending on the connection property).

Hence, just fixing the docs might be easier.

@Luegg Luegg added >docs General docs changes :Analytics/SQL SQL querying v7.16.1 labels Oct 21, 2021
@elasticmachine elasticmachine added Team:QL (Deprecated) Meta label for query languages team Team:Docs Meta label for docs team labels Oct 21, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

LGTM.
The numbers are normalized internally to ms (since that's the underlying IO APIs use) yet the JDBC spec uses seconds which is where the unit came from.
However the conversion only happens in some cases (namely the defaults).

Btw, I would use port this to 7.16 and 7.15 as well considering it's just a doc change.

@Luegg Luegg added v7.15.2 auto-backport-and-merge Automatically create backport pull requests and merge when ready labels Oct 25, 2021
Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

LGTM
but I would eliminate the ms from the default value. Us mentioning 30000ms as a default value, users might understand the code should look like

Properties props = new Properties();
props.put("query.timeout", "30000ms");

which is not actually the case. The property only accepts a long value, no time unit after the value itself.

@Luegg
Copy link
Contributor Author

Luegg commented Oct 26, 2021

Thanks @astefan, I've fixed the defaults (and also ensured that all defaults in this doc page are wrapped in ticks `)

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

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

LGTM

@Luegg Luegg merged commit 008daa1 into elastic:master Oct 26, 2021
@Luegg Luegg deleted the fix/jdbcTimeoutsInSeconds branch October 26, 2021 11:44
Luegg pushed a commit to Luegg/elasticsearch that referenced this pull request Oct 26, 2021
Resolves elastic#79480

My initial thought was to change the properties to be interpreted as seconds but this might not be worth it. All relevant places in the code seem to assume the timeouts to be in ms and there does not seem to be a consistent use of ms or s across JDBC drivers (Postgres uses seconds, MySQL uses ms, MS SQL mixes the two depending on the connection property).

Hence, just fixing the docs might be easier.
Luegg pushed a commit to Luegg/elasticsearch that referenced this pull request Oct 26, 2021
Resolves elastic#79480

My initial thought was to change the properties to be interpreted as seconds but this might not be worth it. All relevant places in the code seem to assume the timeouts to be in ms and there does not seem to be a consistent use of ms or s across JDBC drivers (Postgres uses seconds, MySQL uses ms, MS SQL mixes the two depending on the connection property).

Hence, just fixing the docs might be easier.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
7.15
7.16

elasticsearchmachine pushed a commit that referenced this pull request Oct 26, 2021
Resolves #79480

My initial thought was to change the properties to be interpreted as seconds but this might not be worth it. All relevant places in the code seem to assume the timeouts to be in ms and there does not seem to be a consistent use of ms or s across JDBC drivers (Postgres uses seconds, MySQL uses ms, MS SQL mixes the two depending on the connection property).

Hence, just fixing the docs might be easier.
elasticsearchmachine pushed a commit that referenced this pull request Oct 26, 2021
Resolves #79480

My initial thought was to change the properties to be interpreted as seconds but this might not be worth it. All relevant places in the code seem to assume the timeouts to be in ms and there does not seem to be a consistent use of ms or s across JDBC drivers (Postgres uses seconds, MySQL uses ms, MS SQL mixes the two depending on the connection property).

Hence, just fixing the docs might be easier.
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Oct 26, 2021
* upstream/master: (209 commits)
  Enforce license expiration (elastic#79671)
  TSDB: Automatically add timestamp mapper (elastic#79136)
  [DOCS]  `_id` is required for bulk API's `update` action (elastic#79774)
  EQL: Add optional fields and limit joining keys on non-null values only (elastic#79677)
  [DOCS] Document range enrich policy (elastic#79607)
  [DOCS] Fix typos in 8.0 security migration (elastic#79802)
  Allow listing older repositories (elastic#78244)
  [ML] track inference model feature usage per node (elastic#79752)
  Remove IncrementalClusterStateWriter & related code (elastic#79738)
  Reuse previous indices lookup when possible (elastic#79004)
  Reduce merging in PersistedClusterStateService (elastic#79793)
  SQL: Adjust JDBC docs to use milliseconds for timeouts (elastic#79628)
  Remove endpoint for freezing indices (elastic#78918)
  [ML] add timeout parameter for DELETE trained_models API (elastic#79739)
  [ML] wait for .ml-state-write alias to be readable (elastic#79731)
  [Docs] Update edgengram-tokenizer.asciidoc (elastic#79577)
  [Test][Transform] fix UpdateTransformActionRequestTests failure (elastic#79787)
  Limit CS Update Task Description Size (elastic#79443)
  Apply the reader wrapper on can_match source (elastic#78988)
  [DOCS] Adds new transform limitation item and a note to the tutorial (elastic#79479)
  ...

# Conflicts:
#	server/src/main/java/org/elasticsearch/index/IndexMode.java
#	server/src/test/java/org/elasticsearch/index/TimeSeriesModeTests.java
@jakelandis jakelandis removed the v8.0.0 label Oct 27, 2021
lockewritesdocs pushed a commit to lockewritesdocs/elasticsearch that referenced this pull request Oct 28, 2021
Resolves elastic#79480

My initial thought was to change the properties to be interpreted as seconds but this might not be worth it. All relevant places in the code seem to assume the timeouts to be in ms and there does not seem to be a consistent use of ms or s across JDBC drivers (Postgres uses seconds, MySQL uses ms, MS SQL mixes the two depending on the connection property).

Hence, just fixing the docs might be easier.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/SQL SQL querying auto-backport-and-merge Automatically create backport pull requests and merge when ready >docs General docs changes Team:Docs Meta label for docs team Team:QL (Deprecated) Meta label for query languages team v7.15.2 v7.16.0 v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL: JDBC timeout properties are parsed in ms instead of seconds
8 participants