Skip to content

Conversation

@nausharipov
Copy link
Collaborator

Refinement of the tobf-all-tasks-28-03-23 branch.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@nausharipov nausharipov requested a review from alexeyinkin March 29, 2023 04:58
@nausharipov nausharipov marked this pull request as ready for review March 29, 2023 09:06
@nausharipov nausharipov requested a review from alexeyinkin March 29, 2023 14:51
@nausharipov nausharipov requested a review from alexeyinkin March 30, 2023 12:02

// ignore: avoid_catches_without_on_clauses
} catch (ex, trace) {
} catch (_) {

Choose a reason for hiding this comment

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

This way we lose details of the first exception when loading a precompiled object and only report the exception of loading a snippet. So far we do not use those details anyway and only report "Error loading example" but I do not like losing it.

Options are:

  • Synthesize an exception to contain multiple exceptions, throw it here.
  • Add both exceptions to ToastNotifier here. I do not like this because it mixes responsibilities.

Or we can just add a TODO to preserve both exceptions later.

Copy link
Collaborator Author

@nausharipov nausharipov Mar 30, 2023

Choose a reason for hiding this comment

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

From completeError doc:
Calling [complete] or [completeError] must be done at most once.

Can exception and stackTrace be passed as arguments into _tryLoadSharedExample?

@alexeyinkin

_completer.complete(example);
} on Exception catch (ex, trace) {
_completer.completeError(ex, trace);
return;
Copy link
Collaborator Author

@nausharipov nausharipov Mar 30, 2023

Choose a reason for hiding this comment

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

Can I delete this return? @alexeyinkin

@nausharipov nausharipov requested a review from alexeyinkin March 30, 2023 13:46

class MultipleExceptions implements Exception {
final List<Exception> exceptions;

Choose a reason for hiding this comment

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

Add traces, they can also be useful.

exampleCache.loadExampleInfo(example),
await exampleCache.loadExampleInfo(exampleBase),
);
} on Exception catch (loadPrecompiledExampleException) {

Choose a reason for hiding this comment

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

Suggested change
} on Exception catch (loadPrecompiledExampleException) {
} on Exception catch (ex, trace) {

No need for long names for local variables.

_completer.completeError(ex, trace);
return;
Future<void> _tryLoadSharedExample({
required Exception previousException,

Choose a reason for hiding this comment

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

A list was a better idea because that way the order of attempts can be changed easier.

@nausharipov nausharipov requested a review from alexeyinkin March 30, 2023 14:11
Copy link

@alexeyinkin alexeyinkin left a comment

Choose a reason for hiding this comment

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

LGTM (Internal review).

@nausharipov nausharipov merged commit 930771c into tobf-all-tasks-28-03-23 Mar 31, 2023
@nausharipov nausharipov deleted the tobf-28-03-fixes branch March 31, 2023 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants