Closed Bug 1531583 Opened 5 years ago Closed 5 years ago

[socket process] cherry-pick and rebase non-mc patches

Categories

(Core :: Networking, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: CuveeHsu, Assigned: CuveeHsu)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(5 files, 11 obsolete files)

5.92 KB, text/plain
Details
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
451.62 KB, application/octet-stream
Details
Attached file commits

We're suffering from merging m-c to larch project [1]

We push some commits and merge from m-c several times.
The last merge [2] is based on [3]

The goal is to cherry-pick the patches (list in the attachments) to the top of [3] in larch. [2] is a workable version. If the result of rebase is not workable, we might add a patch on top to make it as same as [2].
We might reset the larch remote repo. Just make sure we finish the rebase well.

If the rebase is too complicated, we might make a big patch which is diff of [2] and [3]. However this makes the patch hard to review. We want to land these patch back when we're ready.

[1] https://hg.mozilla.org/projects/larch
[2] https://hg.mozilla.org/projects/larch/pushloghtml?changeset=ce8802224f86
[3] https://hg.mozilla.org/mozilla-central/pushloghtml?changeset=93c4470ee3af

I had one idea that could benefit from hg rebase and its capabilities to simplify merging patches.

Let's say that we:

  • pull from mozilla-central to larch, but don't update or merge
  • we end up having few blocks (sub branches) on larch, as depicted:
O -- current (or recent) mozilla-central `default` (changeset B)
|
?
|
O -- a merge commit of m-c to larch, joining the larch specific patches and m-c
|\
| \
|  O -- larch specific patch2
|  |
|  |
|  O -- larch specific patch1
| /
|/
O -- a base (parent) changeset which can be found also on m-c
|
|
V

If there are more blocks (sub branches) like these, find the oldest one. Then, I think that if you update to patch2 (or in general - the top-most patch in the sub-branch) and do hg rebase -d default, or -d <hash of B> to be sure you do the right thing, it will move the patches patch1 and patch2 (or in general - the whole sub-branch) on top of the current m-c default changeset (B) and rebase them (offering the 3-diff tool to merge conflicts it can't resolve automatically). It should then look like this:

O -- patch2, changeset B2
|
|
O -- patch1
|
|
O -- mozilla-central common default, changeset B
|
|
O
|
?  ... other sub branches specific to larch...
|
V

Then you repeat again for another oldest sub-branch, but this time you will obviously hg rebase -d <hash of B2>.

And so on.

It would be good to do this on a separate (new) clone of larch in case something goes wrong, to prevent destruction of your development tree.

I don't think this bug belongs in the hg developer services bucket. Our team initializes project repos for teams but it looks like the requirements on this bug are for a better merging strategy for your team. Is there an action here you would like us to take?

Flags: needinfo?(juhsu)

(In reply to Kim Moir [:kmoir] ET from comment #2)

I don't think this bug belongs in the hg developer services bucket. Our team initializes project repos for teams but it looks like the requirements on this bug are for a better merging strategy for your team. Is there an action here you would like us to take?

Right, it seems pointless to reset the repo.

Flags: needinfo?(juhsu)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX

Let's move to Core::Networking

Assignee: nobody → juhsu
Component: Mercurial: hg.mozilla.org → Networking
Priority: -- → P1
Product: Developer Services → Core
Summary: cherry-pick and rebase non-mc patches to the head in larch project → [socket process] cherry-pick and rebase non-mc patches
Whiteboard: [necko-triaged]
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Attachment #9048746 - Attachment description: P1: Bug 1485353 - P1 create HttpTransactionParent/Child to pretend IPC → P01: Bug 1485353 - P1 create HttpTransactionParent/Child to pretend IPC

As comment 1 said, when OnStart fails, we must not call OnData and propagate
the error to OnStop.

Please note this patch might not cover the whole "stream listener contract".

netwerk/protocol/http/HttpTransactionParent.cpp | 32 ++++++++++++++++++-------
1 file changed, 24 insertions(+), 8 deletions(-)

(a) able to dispatch Reschedule/Cancel/UpdateClassOfService to socket process
(b) able to send priority to socket priority during init
(c) encapsulate the pump init logic under nsAHttpTransactionShell

Bug 1497236 - serialize timings for socket process

Bug 1497238 - move SetDNSWasRefresh to nsAHttpTransactionShell

Bug 1497235 - P1: Pass request context id to HttpTransactionChild, r=JuniorHsu

Bug 1497235 - P2: Pass ProxyInfo to socket process, r=JuniorHsu

Bug 1497235 - P3: Pass classOfService to socket process, r=dragana

Simply pass classOfService to socket process via Init() message.

Attachment #9049404 - Attachment description: Bug 1510691 - [socket-proc] Send OnDataAvailable directly to the content process r=dragana! → P11 Bug 1510691 - [socket-proc] Send OnDataAvailable directly to the content process r=dragana!

(In reply to Junior [:junior] from comment #14)

Created attachment 9049366 [details]
P10 Pass timings, SetDNSWasRefresh, request context, proxy info and cos to socket process

Bug 1497236 - serialize timings for socket process

Bug 1497238 - move SetDNSWasRefresh to nsAHttpTransactionShell

Bug 1497235 - P1: Pass request context id to HttpTransactionChild, r=JuniorHsu

Bug 1497235 - P2: Pass ProxyInfo to socket process, r=JuniorHsu

Bug 1497235 - P3: Pass classOfService to socket process, r=dragana

Simply pass classOfService to socket process via Init() message.

Also fold Bug 1521817 into this patch

Finish rebasing scaffold. Ask some reviews (P1, P3, P11) for the heavy-conflicted patches to make sure I'm not just going wonky-eyed

Attachment #9049657 - Attachment description: Bug 1497237 - Pass response trailers via SendOnStopRequest, r=valentin → P12 Bug 1497237 - Pass response trailers via SendOnStopRequest, r=valentin

Bug 1509822 - P1: Decouple nsHttpConnectionMgr and AltSvcCache, r=dragana

Bug 1509822 - P2: Send observer notifications to socket process, r=dragana

Bug 1509822 - P3: Get HttpData from socket process, r=dragana

Bug 1509822 - P4: Send IPC message for DoShiftReloadConnectionCleanup, r=dragana

Bug 1509822 - P5: Not create connection manager in parent process, r=dragana

Attachment #9049659 - Attachment description: Bug 1509822 - P1: Decouple nsHttpConnectionMgr and AltSvcCache, r=dragana → P13 Bug 1509822 - Stop using HTTP connection manager on the parent process
Attached file P14 enable socket process by default (obsolete) —
Attachment #9049662 - Attachment description: Add missing pref and enable socket process by default. → P14 Add missing pref and enable socket process by default.
Attachment #9049662 - Attachment description: P14 Add missing pref and enable socket process by default. → P14 enable socket process by default
Attachment #9049662 - Attachment description: P14 enable socket process by default → enable socket process by default
Attachment #9049662 - Attachment description: enable socket process by default → P14 enable socket process by default

Finish rebasing with some warnings (request Http before socket process ready) and small crashes in Preferences.cpp

Attached file big_diff_patch

Want to put some basic hg trick here:

My final workflow is pretty simple: directly cherry-pick those patches we want

  1. hg pull central and hg up ce8802224f86 which is the same parent with our last merge commit.
  2. Look at each pushlog, compare to bug 1513057 and have a list (attachment 9047548 [details]) to rebase in order
  3. For each patch: do hg graft <changeset>, solve conflict (usually ref from [2]), make it build and run a simple test
  4. Put these patches to phab (no worry for the author information. They are kept in local and I'll push them handy)

hg graft and even hg rebase take care of the clang-format except the conflict, which is good.
Have a quick check to avoid this false modification:

LOG(
    ("some logging"));

Here's reason for not doing other ways:
a. to make a big diff patch from [2] and [3]
Attach is the diff file, resulted from hg up larch && hg merge --tool=internal:merge-other ce8802224f86
Sometimes it fails during the merge, we can use this to continue hg resolve -t internal:other --all

The patch consists of lots of format change, and some inconsistent changes.
More important, one patch is hard to review when we want to land back to central.

Btw, making the patch takes >4 hours in my i7 desktop.

b. hg rebase patches to the parent of next patch instead of hg graft to the top
First of all, larch and central are from remote, so patches from the larch is not rebase-able.
We need to hg phase -r <changeset> -d --force to force it to draft phase.
It will ruin the local tree for a while (which I don't like it)
Once we finish, we can hg pull again to make it back to remote phase.

Here's some analysis:
There are four merges after Honza's final rebase pushlog
Merge brings conflict, and our patch also changes after conflict resolved.
And I also fold those build-break patches into the corresponding patch.
Hence, rebase could not apply clearly afterwards, which should be true since I still solving conflict in the last patches.

We might use hg phase and hg rebase trick if central is not changing a lot.
However, bug 1522579 carries lots of conflict for next rebase, though.

However, bug 1522579 carries lots of conflict for next rebase, though.

pContentBridge has nothing to do with us. My bad.

Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Attachment #9048747 - Attachment is obsolete: true
Attachment #9049025 - Attachment is obsolete: true
Attachment #9049041 - Attachment is obsolete: true
Attachment #9049045 - Attachment is obsolete: true
Attachment #9049274 - Attachment is obsolete: true
Attachment #9049291 - Attachment is obsolete: true
Attachment #9049297 - Attachment is obsolete: true
Attachment #9049366 - Attachment is obsolete: true
Attachment #9049657 - Attachment is obsolete: true
Attachment #9049659 - Attachment is obsolete: true
Attachment #9049662 - Attachment is obsolete: true
See Also: → 1540181
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: