Running tasks on a node get terminated when node is shutdown

I have a cluster with 3 nodes and trying to upgrade it from 6.6.2 to 7.10.2 using rolling upgrade. The documentation says that we shutdown the node and upgrade it to target version and performing this for all the nodes one by one without any downtime. But I am observing that upgrade is successful but some of the running tasks on the nodes got terminated when nodes were shutdown. Is there a way to ensure that running tasks on the nodes don't terminate while the node is being shutdown for upgrade?
Additionally, I tried the following API to decomission the node before shutdown but only shards are being migrated to other nodes and tasks keep running on the same node -

PUT _cluster/settings
{
  "transient": {
    "cluster.routing.allocation.exclude._ip": "192.168.2.*"
  }
}

May be the task API could help?

More importantly, you must first do a rolling upgrade to the latest 6.8 version first.

@dadoonet Unfortunatley that doesn't work. Now I will have to wait for the tasks to complete before shutting down the node for upgrade.