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

`worker_id` type changed to uuid #25211

Merged
merged 4 commits into from Dec 16, 2019
Merged

`worker_id` type changed to uuid #25211

merged 4 commits into from Dec 16, 2019

Conversation

@kunalmohan
Copy link
Collaborator

kunalmohan commented Dec 8, 2019

Fixes #6631
worker_id is now generate as uuid and saved as string.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #6631 (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because ___
@highfive
Copy link

highfive commented Dec 8, 2019

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @paulrouget (or someone else) soon.

@highfive
Copy link

highfive commented Dec 8, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/globalscope.rs, components/script/Cargo.toml, components/script/serviceworker_manager.rs
  • @KiChjang: components/script/dom/globalscope.rs, components/script/Cargo.toml, components/script/serviceworker_manager.rs
@highfive
Copy link

highfive commented Dec 8, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)]
pub struct WorkerId(pub u32);
#[derive(Clone, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)]
pub struct WorkerId(pub String);

This comment has been minimized.

@paulrouget

paulrouget Dec 9, 2019

Contributor

You can keep uuid and implement malloc_size_of, or maybe use u128 (https://docs.rs/uuid/0.8.1/uuid/struct.Uuid.html#method.to_u128_le).

@@ -94,7 +95,7 @@ impl Drop for AutoCloseWorker {
pub struct GlobalScope {
eventtarget: EventTarget,
crypto: MutNullableDom<Crypto>,
next_worker_id: Cell<WorkerId>,
next_worker_id: WorkerId,

This comment has been minimized.

@paulrouget

paulrouget Dec 9, 2019

Contributor

I don't think that field is necessary anymore. Just create a new uuid when necessary.

@kunalmohan
Copy link
Collaborator Author

kunalmohan commented Dec 9, 2019

Ok. I'll start working on these changes.
A small query (and probably a silly one)- malloc_size_of for UUID should return 0, right?

@paulrouget
Copy link
Contributor

paulrouget commented Dec 10, 2019

malloc_size_of for UUID should return 0, right?

I don't know. @jdm ?

@jdm
Copy link
Member

jdm commented Dec 10, 2019

Yes, that's fine.

kunalmohan added 3 commits Dec 8, 2019
Fixes #6631
`worker_id` is now generate as uuid and saved as string.
@kunalmohan
Copy link
Collaborator Author

kunalmohan commented Dec 10, 2019

I have changed worker_id to uuid and implemented malloc_size_of.

@@ -47,3 +47,4 @@ url = { version = "2.0", optional = true }
webrender_api = { git = "https://github.com/servo/webrender", optional = true }
xml5ever = { version = "0.16", optional = true }
void = "1.0.2"
uuid = {version = "0.8", features = ["v4", "serde"]}

This comment has been minimized.

@paulrouget

paulrouget Dec 10, 2019

Contributor

Is "serde" necessary?

This comment has been minimized.

@kunalmohan

kunalmohan Dec 10, 2019

Author Collaborator

I guess I can remove serde here.

This comment has been minimized.

@jdm

jdm Dec 10, 2019

Member

Please make uuid optional and enable it as part of the servo feature.

This comment has been minimized.

@kunalmohan

kunalmohan Dec 11, 2019

Author Collaborator

I have removed serde here and made the other changes too.

components/malloc_size_of/lib.rs Show resolved Hide resolved
@kunalmohan kunalmohan requested a review from jdm Dec 13, 2019
@jdm
Copy link
Member

jdm commented Dec 13, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2019

📌 Commit a892102 has been approved by jdm

@highfive highfive assigned jdm and unassigned paulrouget Dec 13, 2019
@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2019

Testing commit a892102 with merge dad8784...

bors-servo added a commit that referenced this pull request Dec 13, 2019
`worker_id` type changed to uuid

<!-- Please describe your changes on the following line: -->
Fixes #6631
`worker_id` is now generate as uuid and saved as string.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #6631  (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Dec 13, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2019

Testing commit a892102 with merge d4c6333...

bors-servo added a commit that referenced this pull request Dec 13, 2019
`worker_id` type changed to uuid

<!-- Please describe your changes on the following line: -->
Fixes #6631
`worker_id` is now generate as uuid and saved as string.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #6631  (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@CYBAI
Copy link
Collaborator

CYBAI commented Dec 16, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 16, 2019

Testing commit a892102 with merge fca99fd...

bors-servo added a commit that referenced this pull request Dec 16, 2019
`worker_id` type changed to uuid

<!-- Please describe your changes on the following line: -->
Fixes #6631
`worker_id` is now generate as uuid and saved as string.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #6631  (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 16, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Dec 16, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 16, 2019

Testing commit a892102 with merge c9baa5b...

bors-servo added a commit that referenced this pull request Dec 16, 2019
`worker_id` type changed to uuid

<!-- Please describe your changes on the following line: -->
Fixes #6631
`worker_id` is now generate as uuid and saved as string.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #6631  (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 16, 2019

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing c9baa5b to master...

@bors-servo bors-servo merged commit a892102 into servo:master Dec 16, 2019
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
@kunalmohan kunalmohan deleted the kunalmohan:6631-Worker-Id branch Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants
You can’t perform that action at this time.