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

Misc fixes to C# locator discovery #3177

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

bernardnormier
Copy link
Member

This PR fixes a couple bugs in the C# LocatorDiscovery and removes dead code.

See also #2813.

@@ -11,11 +11,6 @@ public Ice.Plugin
create(Ice.Communicator communicator, string name, string[] args) => new PluginI(communicator);
}

public interface Plugin : Ice.Plugin
Copy link
Member Author

Choose a reason for hiding this comment

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

We use this (obviously) internal API in C++ and Java, but not in C#, where it's internal unused code.

{
while (!_locators.ContainsKey(instanceName) && _pending)
{
Monitor.Wait(_mutex, waitTime);
Copy link
Member Author

Choose a reason for hiding this comment

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

The only Monitor.Wait(_mutex, ...), which means all the Monitor.Pulse(_mutex) elsewhere are useless.

{
// Exit the mutex lock before proceeding.
Copy link
Member Author

Choose a reason for hiding this comment

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

Awaiting a remote call with a mutex lock (see below) is incorrect and deadlock prone. It could be the cause for #2813.

Copy link
Member

@pepone pepone left a comment

Choose a reason for hiding this comment

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

Looks good.

Is the runTimerTask also unused internal code?

jose@mac IceLocatorDiscovery % rg runTimerTask
PluginI.cs
526:    public void runTimerTask()
``

@bernardnormier
Copy link
Member Author

The timer task (and runTimerTask) are used, e.g.

         _timer.schedule(this, _timeout);

@bernardnormier bernardnormier merged commit 6954acd into zeroc-ice:main Nov 22, 2024
19 checks passed
@bernardnormier bernardnormier deleted the locator-discovery-fix branch December 9, 2024 17:10
InsertCreativityHere pushed a commit to InsertCreativityHere/compiler-comparison that referenced this pull request Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants