ansys / ansys/pyensight

event callbacks that make gRPC calls can cause race conditions

Open
#111 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10
Forks
2
Avg merge
8h 40m
Merged PRs (30d)
4

Description

There are two potential issues here:

1) if a callback makes another implicit gRPC call, it can cause re-entrancy problems (e.g. the gRPC connection can be shut down)
2) repeated callbacks can queue client side and cause gil contention in the client Python

In any case, the current implementation can cause problems with calls like this:

session.ensight.objs.core.parts[("hood", "engine")].set_attr(session.ensight.enums.VISIBLE, False)

for a class-based callback associated with the "VISIBLE" attribute. The current work-around is to use macro expansion in the callback string to avoid the conflict in most cases.

Contributor guide

Open the contributing guide

Research direction

Start with the class-based callback path for the VISIBLE attribute and reproduce the shown set_attr call. Compare its behavior with the macro-expansion workaround, then establish tests for safe handling of re-entrant gRPC calls and repeated callbacks without client-side queuing or GIL contention.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, python
Domain
api, backend-api-design
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.