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

[SPARK][FLINK][JAVA] http timeout fix #2475

Merged
merged 1 commit into from Mar 1, 2024
Merged

Conversation

pawel-big-lebowski
Copy link
Contributor

@pawel-big-lebowski pawel-big-lebowski commented Feb 28, 2024

Problem

Documentation says timeout should be provided in millis
Screenshot 2024-02-28 at 09 56 37

But the code treats it as if it was provided in seconds

Fixes #2474

Solution

  • Write failing test
  • Modify the code

Note: All schema changes require discussion. Please link the issue for context.

  • Your change modifies the core OpenLineage model
  • Your change modifies one or more OpenLineage facets

If you're contributing a new integration, please specify the scope of the integration and how/where it has been tested (e.g., Apache Spark integration supports S3 and GCS filesystem operations, tested with AWS EMR).

One-line summary:

Checklist

  • You've signed-off your work
  • Your pull request title follows our guidelines
  • Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • Your comment includes a one-liner for the changelog about the specific purpose of the change (if necessary)
  • You've versioned the core OpenLineage model or facets according to SchemaVer (if relevant)
  • You've added a header to source files (if relevant)

SPDX-License-Identifier: Apache-2.0
Copyright 2018-2023 contributors to the OpenLineage project

@boring-cyborg boring-cyborg bot added area:client/java openlineage-java area:documentation Improvements or additions to documentation labels Feb 28, 2024
@pawel-big-lebowski pawel-big-lebowski marked this pull request as ready for review February 28, 2024 08:59
@mobuchowski
Copy link
Member

@pawel-big-lebowski I think we should do this other way around and make docs fit the reality rather than breaking the timeout for people using floats

@pawel-big-lebowski
Copy link
Contributor Author

pawel-big-lebowski commented Feb 28, 2024

@pawel-big-lebowski I think we should do this other way around and make docs fit the reality rather than breaking the timeout for people using floats

@mobuchowski I was thinking about this as well and I think we shouldn't. Suppose there's a user who configured timeout to 10000 and lives unaware of the fact timeout settings will not work. Once we fix it, timeout will work again. If we change the docs, timeout settings for such users will be still broken.

So the tradeoff is: shall we break the contract for those who follow the docs and are unaware of the problem or shall we break the contract for those (probably a single user) who found out the cause and hacked the system?

Additionally, circuit breaker timeout also uses milliseconds.

@mobuchowski
Copy link
Member

@pawel-big-lebowski maybe we can check if the passed value is single digit and then assume seconds? IDK, I just would not be happy if my integration stopped sending events because it started applying the 5ms timeout.

@d-m-h
Copy link
Contributor

d-m-h commented Feb 28, 2024

My 2 cents:

  1. Add an explicit configuration (property) to specify the time unit (minutes, seconds, milliseconds)
  2. Default the above time unit to whatever the behaviour is now.
  3. Allow users to configure accordingly.

This way, you remove the ambiguity of "is this 5 milliseconds, or 5 seconds?"

For example:

spark.openlineage.transport.timeout=5000
spark.openlineage.transport.timeout.chrono-unit=seconds # This is the current behaviour, right?

@pawel-big-lebowski
Copy link
Contributor Author

Nice idea from offline discussions to make as many people happy as possible

  • We leave timeout as is in http config (treat it in seconds, remove it from docs), we mark config entry deprecated in the code
  • We include timeoutMillis config entry and take its value for timeout if it's present

@mobuchowski would it make sense to you?

@tatiana
Copy link
Contributor

tatiana commented Feb 28, 2024

Nice idea from offline discussions to make as many people happy as possible

  • We leave timeout as is in http config (treat it in seconds, remove it from docs), we mark config entry deprecated in the code
  • We include timeoutMillis config entry and take its value for timeout if it's present

@mobuchowski would it make sense to you?

I really like this strategy, @pawel-big-lebowski , since it is backwards compatible and also supports users specifying milliseconds. Credits to @julienledem from our chat yesterday :D

Signed-off-by: Pawel Leszczynski <leszczynski.pawel@gmail.com>
@pawel-big-lebowski pawel-big-lebowski merged commit 39711a1 into main Mar 1, 2024
38 checks passed
@pawel-big-lebowski pawel-big-lebowski deleted the java/http-timeout branch March 1, 2024 13:26
Ruihua98 pushed a commit to Ruihua98/OpenLineage that referenced this pull request Mar 15, 2024
Signed-off-by: Pawel Leszczynski <leszczynski.pawel@gmail.com>
Signed-off-by: Ruihua Wang <ruihuawang@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:client/java openlineage-java area:documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HttpTransport timeout unit unclear
4 participants