Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Objects do not propagate across parfor, need save/load methods

Open
#98 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, matlab

Research direction

Start with opentelemetry.trace.Tracer/startSpan, especially the reported failure at line 125, and review how the global singleton proxymanager handles proxies across parfor workers. Investigate the custom save/load methods requested for objects and their C++ counterparts. Done means the tracer and related objects propagate through the shown parfor example without the Unknown proxy ID 3 error.

Written by the indexing model from the issue text.

Description

enhancement

The following code would fail:

tr = opentelemetry.trace.getTracer("parfor_example");
sp = startSpan(tr, "main function");
...
parfor i = 1:8
% start a span for this iteration, using the tracer “tr” from main function
sp_i = startSpan(tr, "Iteration" + i);
...
end

Since tr is used both in and outside of the parfor block, parfor would copy and send it to the workers. Running this code would result in this error:

Error using . (line 63)
Unknown proxy ID 3

Error in opentelemetry.trace.Tracer/startSpan (line 125)
id = obj.Proxy.startSpan(spname, contextid, spankind, starttime, ...

This is because the global singleton proxymanager is not copied. In the workers, the proxies only exist in MATLAB but not in C++.

To make objects correctly propagate through to parfor blocks, they need to implement custom save/load methods which should also save/load their C++ counterparts.

Dominant language
MATLAB
Stars
19
Forks
4
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mathworks/OpenTelemetry-MATLAB

All issues in mathworks/OpenTelemetry-MATLAB

Similar issues

More MATLAB issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.