Skip to content

updated processEvent to process dispatching of events in parallel - #3362

Draft
supravi96 wants to merge 1 commit into
codefori:masterfrom
supravi96:fix/workspace-registeration-delay-bob
Draft

updated processEvent to process dispatching of events in parallel#3362
supravi96 wants to merge 1 commit into
codefori:masterfrom
supravi96:fix/workspace-registeration-delay-bob

Conversation

@supravi96

@supravi96 supravi96 commented Jul 14, 2026

Copy link
Copy Markdown

Changes

Currently once event is fired then order in which notifications are dispatched is sequential so some subscribers face delay in receiving notifications . Hence this pr will provide the changes that will make the processing parallelly not just one or two subscribers facing delay. This will resolve issue https://github.ibm.com/bob-for-ibm-i/vscode-ibmi-bob/issues/679

How to test this PR

Checklist

  • have tested my change
  • have created one or more test cases
  • updated relevant documentation
  • Remove any/all console.logs I added
  • have added myself to the contributors' list in CONTRIBUTING.md

@sebjulliand

Copy link
Copy Markdown
Member

Having this loop to be sequential was made on purpose, originally because having too many parallel requests sent on the ssh channel would cause "ssh channel error" issues.

With v3 and the introduction of Mapepire for SQL and CL commands, I reckon this won't happen as often. But still, if the event processing becomes sequential, we need a queue system for the ssh commands to prevent some events from crashing.

@SanjulaGanepola

SanjulaGanepola commented Jul 15, 2026

Copy link
Copy Markdown
Member

@sebjulliand For context, Supravi was discussing this one with me because the team noticed delays in other extensions that were subscribing to the connected event. With the current implementation, I guess this is because there is a growing number of extensions subscribing to this event and so extensions that get registered late, may find some slow down given we are doing this sequentially.

queue system for the ssh commands

If we did this, I wonder if this would actually slow things down for certain users which would not be good.

As of right now, we don't make use of Pools in Mapepire. Have we considered doing this? Or does that introduce more issues given that then we will have multiple SQL jobs.

@sebjulliand

Copy link
Copy Markdown
Member

@SanjulaGanepola Mapepire is not the issue here; it has its own queue and there is no concurrency problem with it in Code for i as far as I can tell.

So as long as subscribers run CL commands/SQL queries, it won't be a problem running everything in parallel, the queue will take care of handling that.

The "Can't open SSH channel" issue seems to happen on some systems, maybe based on sshd settings. It happens for me when Mapepire is started, so...at a very early stage 馃ぃ

I think haveing this PR tested and merged would be fine, the risk is limited.

Then we should take a look at the channel thing separatly.

@SanjulaGanepola

Copy link
Copy Markdown
Member

@supravi96 I am currently looking into investigating the use of Mapepire Pools in Code4i which impact this. I will revisit this PR afterwards

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