Skip to content
Permalink
Browse files

add comments

  • Loading branch information...
gterzian committed Nov 8, 2019
1 parent 5ac1d3c commit 04594aaa54206122f735102eafcf9572e98f636c
Showing with 33 additions and 6 deletions.
  1. +33 −6 components/constellation/constellation.rs
@@ -186,9 +186,12 @@ enum TransferState {
/// The port is currently in-transfer,
/// and incoming tasks should be buffered until it becomes managed again.
TransferInProgress(VecDeque<PortMessageTask>),
/// A global has requested the transfer to be completed, we wait for comfirmation it completed.
/// A global has requested the transfer to be completed,
/// it's pending a confirmation of either failure or success to complete the transfer.
CompletionInProgress(MessagePortRouterId),
/// A transfer failed to complete, we start buffering messages,
/// While a completion of a transfer was in progress, the port was shipped,
/// hence the transfer failed to complete.
/// We start buffering incoming messages,
/// while awaiting the return of the previous buffer from the global
/// that failed to complete the transfer.
CompletionFailed(VecDeque<PortMessageTask>),
@@ -1819,6 +1822,8 @@ where
continue;
},
TransferState::CompletionInProgress(expected_router_id) => {
// Here, the transfer was normally completed.

if expected_router_id != router_id {
return warn!("Transfer completed by an unexpected router: {:?}", router_id);
}
@@ -1856,6 +1861,10 @@ where
continue;
},
TransferState::CompletionFailed(mut current_buffer) => {
// The transfer failed,
// and now the global has returned us the buffer we previously sent.
// So the next update is back to a "normal" transfer in progress.

// Tasks in the previous buffer are older,
// hence need to be added to the front of the current one.
while let Some(task) = previous_buffer.pop_back() {
@@ -1871,12 +1880,19 @@ where
target_router_id,
mut current_buffer,
) => {
// Here, before the global who failed the last transfer could return us the buffer,
// another global already sent us a request to complete a new transfer.
// So we use the returned buffer to update
// the current-buffer(of new incoming messages),
// and we sent everything to the global
// who is waiting for completion of the current transfer.

// Tasks in the previous buffer are older,
// hence need to be added to the front of the current one.
while let Some(task) = previous_buffer.pop_back() {
current_buffer.push_front(task);
}
// Forward the buffered message-queue.
// Forward the buffered message-queue to complete the current transfer.
if let Some(sender) = self.message_port_routers.get(&target_router_id) {
if sender
.send(MessagePortMsg::CompletePendingTransfer(
@@ -1890,6 +1906,7 @@ where
} else {
warn!("No message-port sender for {:?}", router_id);
}

// Update the state to completion-in-progress.
MessagePortInfo {
state: TransferState::CompletionInProgress(target_router_id),
@@ -1938,7 +1955,8 @@ where
TransferState::TransferInProgress(buffer) => {
response.insert(port_id, buffer);

// Update the state to completion-in-progress.
// If the port was in transfer, and a global is requesting completion,
// we note the start of the completion.
MessagePortInfo {
state: TransferState::CompletionInProgress(router_id),
entangled_with: entry.entangled_with,
@@ -1947,7 +1965,10 @@ where
TransferState::CompletionFailed(buffer) => {
response.insert(port_id, buffer);

// Update the state to completion-requested.
// If the completion had already failed,
// this is a request coming from a new global who transfer-received the port,
// while we're still awaiting the return of the buffer
// from the first global who failed.
MessagePortInfo {
state: TransferState::TransferCompletionRequested(
router_id,
@@ -2017,9 +2038,12 @@ where
if let Some(info) = self.message_ports.get_mut(&port_id) {
match info.state {
TransferState::Managed(_) => {
// If shipped while managed, note the start of a transfer.
info.state = TransferState::TransferInProgress(VecDeque::new());
},
TransferState::CompletionInProgress(_) => {
/// If shipped while completion of a transfer was in progress,
/// the completion failed.
info.state = TransferState::CompletionFailed(VecDeque::new());
},
_ => warn!("Unexpected messageport shipped received"),
@@ -2089,7 +2113,10 @@ where
"Constellation asked to remove entangled messageport by a port that was already removed {:?}",
port_id
),
TransferState::TransferInProgress(_) | TransferState::CompletionInProgress(_) | TransferState::CompletionFailed(_) | TransferState::TransferCompletionRequested(_, _) => {
TransferState::TransferInProgress(_) |
TransferState::CompletionInProgress(_) |
TransferState::CompletionFailed(_) |
TransferState::TransferCompletionRequested(_, _) => {
// Note: since the port is in-transer, we don't have a router to send it a message
// to let it know that its entangled port has been removed.
// Hence we mark it so that it will be messaged and removed once the transfer completes.

1 comment on commit 04594aa

@community-tc-integration

This comment has been minimized.

Copy link

community-tc-integration bot commented on 04594aa Nov 8, 2019

Submitting the task to Taskcluster failed. Details

Taskcluster-GitHub attempted to create a task for this event with the following scopes:

[
  "assume:repo:github.com/servo/servo:pull-request",
  "queue:route:statuses",
  "queue:scheduler-id:taskcluster-github"
]

The expansion of these scopes is not sufficient to create the task, leading to the following:

Client ID static/taskcluster/github does not have sufficient scopes and is missing the following scopes:

{
  "AnyOf": [
    {
      "AnyOf": [
        "queue:create-task:highest:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:very-high:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:high:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:medium:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:low:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:very-low:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:lowest:aws-provisioner-v1/servo-docker-untrusted"
      ]
    },
    {
      "AnyOf": [
        "queue:create-task:aws-provisioner-v1/servo-docker-untrusted",
        {
          "AllOf": [
            "queue:define-task:aws-provisioner-v1/servo-docker-untrusted",
            "queue:task-group-id:taskcluster-github/FIIEo7CxQE2h4ybnCitctg",
            "queue:schedule-task:taskcluster-github/FIIEo7CxQE2h4ybnCitctg/FIIEo7CxQE2h4ybnCitctg"
          ]
        }
      ]
    }
  ]
}

This request requires the client to satisfy the following scope expression:

{
  "AllOf": [
    "assume:repo:github.com/servo/servo:pull-request",
    "queue:route:tc-treeherder.v2._/servo-prs.04594aaa54206122f735102eafcf9572e98f636c",
    "queue:route:tc-treeherder-staging.v2._/servo-prs.04594aaa54206122f735102eafcf9572e98f636c",
    "queue:route:statuses",
    {
      "AnyOf": [
        {
          "AllOf": [
            "queue:scheduler-id:taskcluster-github",
            {
              "AnyOf": [
                "queue:create-task:highest:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:very-high:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:high:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:medium:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:low:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:very-low:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:lowest:aws-provisioner-v1/servo-docker-untrusted"
              ]
            }
          ]
        },
        {
          "AnyOf": [
            "queue:create-task:aws-provisioner-v1/servo-docker-untrusted",
            {
              "AllOf": [
                "queue:define-task:aws-provisioner-v1/servo-docker-untrusted",
                "queue:task-group-id:taskcluster-github/FIIEo7CxQE2h4ybnCitctg",
                "queue:schedule-task:taskcluster-github/FIIEo7CxQE2h4ybnCitctg/FIIEo7CxQE2h4ybnCitctg"
              ]
            }
          ]
        }
      ]
    }
  ]
}

  • method: createTask
  • errorCode: InsufficientScopes
  • statusCode: 403
  • time: 2019-11-08T12:29:50.048Z
Please sign in to comment.
You can’t perform that action at this time.