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

[BSP] Lots of task progress notifications with no start/end #3023

Open
ckipp01 opened this issue Feb 19, 2024 · 0 comments
Open

[BSP] Lots of task progress notifications with no start/end #3023

ckipp01 opened this issue Feb 19, 2024 · 0 comments

Comments

@ckipp01
Copy link
Collaborator

ckipp01 commented Feb 19, 2024

I originally brought this up on Discord and @lolgab mentioned he was going to look into it, but I figured I'd create an issue about it just to have something in this repo that we can reference.

The issue is that if you look in the BSP logs you'll see lots of things like this:

[Trace - 02:23:53 PM] Received notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "698381564"
  },
  "eventTime": 1708089833849,
  "message": "[24/53] mill.scalalib.ZincWorkerModule.worker \u003e [3/53] mill.scalalib.ZincWorkerModule.zincLogDebug ",
  "total": 53,
  "progress": 24,
  "unit": "mill.scalalib.ZincWorkerModule.worker"
}

However, there is no build/tastStart or build/taskEnd that goes along with these. Taken from the docs

If a build/taskStart notification has been sent, the server must send build/taskFinish on completion of the same task.

The same goes for the build/taskEnd. In Discord the following was mentioned

I checked the implementation and I think it is not done at the optimal layer, since it parses the ticker logs to generate progresses. It can be done by wrapping the evaluate function so we can send the start and end of tasks and get the progress numbers directly, without parsing the logs.

I'm assuming this is referring to this code here:

override def ticker(s: String): Unit = {
try {
val progressString = s.split(" ")(0)
val progress = progressString.substring(1, progressString.length - 1).split("/")
val params = new TaskProgressParams(new TaskId(taskId.toString))
params.setEventTime(System.currentTimeMillis())
params.setMessage(s)
params.setUnit(s.split(" ")(1))
params.setProgress(progress(0).toLong)
params.setTotal(progress(1).toLong)
client.onBuildTaskProgress(params)
super.ticker(s)
} catch {
case e: Exception => // noop
}
}

@ckipp01 ckipp01 changed the title Lots of task progress notifications with no start/end [BSP] Lots of task progress notifications with no start/end Feb 19, 2024
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

No branches or pull requests

1 participant