You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "zjxxzjwang (via GitHub)" <gi...@apache.org> on 2026/10/12 14:42:08 UTC

[PR] [fix][table_view] Fix deadlock in IsEmpty caused by non-reentrant mutex [pulsar-client-go]

zjxxzjwang opened a new pull request, #1542:
URL: https://github.com/apache/pulsar-client-go/pull/1542

   
   
   ### Modifications
   
   - In `IsEmpty()`, replaced `tv.Size() == 0` with `len(tv.data) == 0` to read the
     map length directly while already holding `dataMu`, avoiding the re-entrant lock.
   
   ### Verifying this change
   
   This change added tests and can be verified as follows:
   
   - Added `TestTableViewIsEmpty` integration test that exercises `IsEmpty()`, `Size()`,
     `ContainsKey()`, and `Keys()` before and after publishing messages. Prior to this
     fix, the test would hang indefinitely due to the deadlock.
   
   ### Does this pull request potentially affect one of the following parts:
   
   - Dependencies (does it add or upgrade a dependency): no
   - The public API: no
   - The schema: no
   - The default values of configurations: no
   - The wire protocol: no
   
   ### Documentation
   
   - Does this pull request introduce a new feature? no
   - If yes, how is the feature documented? not applicable
   - If a feature is not applicable for documentation, explain why? This is a bug fix for an existing API method.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][table_view] Fix deadlock in IsEmpty caused by non-reentrant mutex [pulsar-client-go]

Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on PR #1542:
URL: https://github.com/apache/pulsar-client-go/pull/1542#issuecomment-6284297053

   @zjxxzjwang Done


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][table_view] Fix deadlock in IsEmpty caused by non-reentrant mutex [pulsar-client-go]

Posted by "zjxxzjwang (via GitHub)" <gi...@apache.org>.
zjxxzjwang commented on PR #1542:
URL: https://github.com/apache/pulsar-client-go/pull/1542#issuecomment-6168622837

   @crossoverJie Hello, could you help me merge this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][table_view] Fix deadlock in IsEmpty caused by non-reentrant mutex [pulsar-client-go]

Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie merged PR #1542:
URL: https://github.com/apache/pulsar-client-go/pull/1542


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][table_view] Fix deadlock in IsEmpty caused by non-reentrant mutex [pulsar-client-go]

Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on PR #1542:
URL: https://github.com/apache/pulsar-client-go/pull/1542#issuecomment-6168877783

   @zjxxzjwang The integration test has not been passed yet. Once it is passed, this PR will be merged. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][table_view] Fix deadlock in IsEmpty caused by non-reentrant mutex [pulsar-client-go]

Posted by "zjxxzjwang (via GitHub)" <gi...@apache.org>.
zjxxzjwang commented on PR #1542:
URL: https://github.com/apache/pulsar-client-go/pull/1542#issuecomment-6169456220

   Can you help me re trigger the test? It looks like a testing environment issue, not a code problem @crossoverJie 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][table_view] Fix deadlock in IsEmpty caused by non-reentrant mutex [pulsar-client-go]

Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on PR #1542:
URL: https://github.com/apache/pulsar-client-go/pull/1542#issuecomment-6182097758

   @zjxxzjwang Wait a moment, I'm dealing with this issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][table_view] Fix deadlock in IsEmpty caused by non-reentrant mutex [pulsar-client-go]

Posted by "wolfstudy (via GitHub)" <gi...@apache.org>.
wolfstudy commented on PR #1542:
URL: https://github.com/apache/pulsar-client-go/pull/1542#issuecomment-6136790824

   <img width="1936" height="570" alt="Clipboard_Screenshot_1791857922" src="https://github.com/user-attachments/assets/b631c82d-bebf-4c14-b82e-874108567c26" />
   
   Since `tv.Size` is only called within `IsEmpty`, if it risks triggering a deadlock, you might consider removing the `tv.Size` function to prevent similar issues caused by accidental calls in the future.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][table_view] Fix deadlock in IsEmpty caused by non-reentrant mutex [pulsar-client-go]

Posted by "zjxxzjwang (via GitHub)" <gi...@apache.org>.
zjxxzjwang commented on PR #1542:
URL: https://github.com/apache/pulsar-client-go/pull/1542#issuecomment-6261578433

   > @zjxxzjwang Wait a moment, I'm dealing with this issue.
   
   Hello, has the integration test been fixed? Can you help me trigger the test again @crossoverJie 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org