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

[pip][design] PIP-281: Add notifyError method on PushSource #20807

Merged
merged 6 commits into from
Aug 15, 2023

Conversation

shibd
Copy link
Member

@shibd shibd commented Jul 14, 2023

Motivation

Refer to pip-281.md

BTW: This is a very simple change and is forward compatible. Sorry, I didn't notice that this change requires PIP before, so the related PRs have been merged.

If this PIP vote does not pass, I revert this PR after that.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@shibd shibd added the type/PIP label Jul 14, 2023
@shibd shibd self-assigned this Jul 14, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 14, 2023
pip/pip-281.md Outdated Show resolved Hide resolved
pip/pip-281.md Outdated Show resolved Hide resolved
@shibd shibd requested a review from RobertIndie July 17, 2023 09:39
@Technoboy- Technoboy- added this to the 3.2.0 milestone Jul 31, 2023
@BewareMyPower
Copy link
Contributor

@Anonymitaet Could you help review from a perspective of technical writer?

pip/pip-281.md Outdated Show resolved Hide resolved
pip/pip-281.md Outdated Show resolved Hide resolved
pip/pip-281.md Outdated Show resolved Hide resolved
pip/pip-281.md Outdated Show resolved Hide resolved
pip/pip-281.md Outdated Show resolved Hide resolved
pip/pip-281.md Outdated Show resolved Hide resolved
pip/pip-281.md Outdated Show resolved Hide resolved
@shibd shibd requested a review from Anonymitaet August 2, 2023 08:15
@shibd
Copy link
Member Author

shibd commented Aug 2, 2023

pip/pip-281.md Outdated Show resolved Hide resolved
pip/pip-281.md Outdated Show resolved Hide resolved
@shibd shibd requested a review from Anonymitaet August 5, 2023 01:36
pip/pip-281.md Outdated Show resolved Hide resolved
Co-authored-by: Anonymitaet <50226895+Anonymitaet@users.noreply.github.com>
@shibd shibd requested a review from Anonymitaet August 9, 2023 14:16
@shibd shibd merged commit 9127d89 into apache:master Aug 15, 2023
19 checks passed
RobertIndie added a commit that referenced this pull request Sep 14, 2023
…the fatal exception (#21143)

PIP: #21079 

### Motivation

Currently, the connector and function cannot terminate the function instance if there are fatal exceptions thrown
outside the function instance thread. The current implementation of the connector and Pulsar Function exception handler
cannot handle the fatal exceptions that are thrown outside the function instance thread.

For example, suppose we have a sink connector that uses its own threads to batch-sink the data to an external system. If
any fatal exceptions occur in those threads, the function instance thread will not be aware of them and will
not be able to terminate the connector. This will cause the connector to hang indefinitely. There is a related issue
here: #9464

The same problem exists for the source connector. The source connector may also use a separate thread to fetch data from
an external system. If any fatal exceptions happen in that thread, the connector will also hang forever. This issue has
been observed for the Kafka source connector: #9464. We have fixed it by adding
the notifyError method to the `PushSource` class in PIP-281: #20807. However, this
does not solve the same problem that all source connectors face because not all connectors are implemented based on
the `PushSource` class.

The problem is same for the Pulsar Function. Currently, the function can't throw fatal exceptions to the function
framework. We need to provide a way for the function developer to implement it.

We need a way for the connector and function developers to throw fatal exceptions outside the function instance
thread. The function framework should catch these exceptions and terminate the function accordingly.

### Modifications

 Introduce a new method `fatal` to the context. All the connector implementation code and the function code 
 can use this context and call the `fatal` method to terminate the instance while raising a fatal exception. 
  
 After the connector or function raises the fatal exception, the function instance thread will be interrupted. 
 The function framework then could catch the exception, log it, and then terminate the function instance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test type/PIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants