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(connector): unblock fetch_watermarks in rdkafka #15461

Merged
merged 5 commits into from
Apr 1, 2024

Conversation

wangrunji0408
Copy link
Contributor

@wangrunji0408 wangrunji0408 commented Mar 5, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

This PR bumps madsim-rdkafka. Operations in method fetch_watermarks is now wrapped in tokio::task::spawn_blocking to avoid blocking the current thread. https://github.com/madsim-rs/madsim/pull/196/files https://github.com/madsim-rs/madsim/pull/200/files

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Signed-off-by: Runji Wang <wangrunji0408@163.com>
@wangrunji0408 wangrunji0408 requested a review from tabVersion March 5, 2024 09:40
@wangrunji0408 wangrunji0408 requested a review from a team as a code owner March 5, 2024 09:40
@github-actions github-actions bot added the type/fix Bug fix label Mar 5, 2024
Copy link
Contributor

@tabVersion tabVersion left a comment

Choose a reason for hiding this comment

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

lgtm as no business logic change

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if I understand it correctly:

Right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct

@wangrunji0408
Copy link
Contributor Author

Meta node exited with this error:

2024-03-05T10:04:50.38429495Z ERROR risingwave_meta::stream::source_manager: error happened when tick from connector source worker error=failed to fetch metadata from kafka (message_queue:29092): Kafka error: Meta data fetch error: BrokerTransportFailure (Local: Broker transport failure)

Don't know why. 😕

auto-merge was automatically disabled March 13, 2024 03:50

Merge queue setting changed

@tabVersion
Copy link
Contributor

Meta node exited with this error:

2024-03-05T10:04:50.38429495Z ERROR risingwave_meta::stream::source_manager: error happened when tick from connector source worker error=failed to fetch metadata from kafka (message_queue:29092): Kafka error: Meta data fetch error: BrokerTransportFailure (Local: Broker transport failure)

Don't know why. 😕

seems a network issue? not sure rerun helps

@tabVersion
Copy link
Contributor

got an error from inner

ERROR librdkafka: librdkafka: DESTROY [thrd:app]: Failed to join internal main thread: Resource temporarily unavailable (was process forked?)  

seems we break the rdkafka inner @wangrunji0408

@wangrunji0408
Copy link
Contributor Author

Humm, looks like the raw kafka client can not be sent to another thread. But librdkafka claims it can be called from any thread.

Yes, librdkafka is completely thread-safe (unless otherwise noted in the API documentation). Any API, short of the destructor functions, may be called at any time from any thread.

@tabVersion
Copy link
Contributor

Humm, looks like the raw kafka client can not be sent to another thread. But librdkafka claims it can be called from any thread.

Yes, librdkafka is completely thread-safe (unless otherwise noted in the API documentation). Any API, short of the destructor functions, may be called at any time from any thread.

Seems a kafka issue. Let's leave this in backlog.

@BugenZhao
Copy link
Member

Humm, looks like the raw kafka client can not be sent to another thread. But librdkafka claims it can be called from any thread.

Yes, librdkafka is completely thread-safe (unless otherwise noted in the API documentation). Any API, short of the destructor functions, may be called at any time from any thread.

https://github.com/madsim-rs/madsim/pull/196/files?diff=split#r1535237591 👀

Signed-off-by: Runji Wang <wangrunji0408@163.com>
@wangrunji0408 wangrunji0408 force-pushed the wrj/bump-madsim-rdkafka branch from 0127813 to 536b96a Compare March 22, 2024 15:20
@wangrunji0408 wangrunji0408 enabled auto-merge March 22, 2024 15:22
Signed-off-by: Runji Wang <wangrunji0408@163.com>
@wangrunji0408 wangrunji0408 disabled auto-merge March 22, 2024 15:23
@wangrunji0408 wangrunji0408 enabled auto-merge March 22, 2024 15:23
@wangrunji0408 wangrunji0408 added this pull request to the merge queue Mar 22, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 22, 2024
@yuhao-su
Copy link
Contributor

yuhao-su commented Apr 1, 2024

Any reason this pr not merged?

@BugenZhao BugenZhao added this pull request to the merge queue Apr 1, 2024
Merged via the queue into main with commit a94a1c0 Apr 1, 2024
27 of 28 checks passed
@BugenZhao BugenZhao deleted the wrj/bump-madsim-rdkafka branch April 1, 2024 02:55
MrCroxx pushed a commit that referenced this pull request Apr 1, 2024
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Co-authored-by: Bohan Zhang <tabvision@bupt.icu>
Signed-off-by: MrCroxx <mrcroxx@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants