docker-archive / go-p9p

A modern, performant 9P library for Go.
Apache License 2.0
206 stars 50 forks source link

Rework transport tag allocation logic #15

Closed kennylevinsen closed 8 years ago

kennylevinsen commented 8 years ago

New tag allocation logic that avoids tag collisions, and errors out if a tag cannot be allocated.

stevvooe commented 8 years ago

cc @justincormack

kennylevinsen commented 8 years ago

Summary of changes:

  1. Tag allocation logic extracted to a method.
  2. Tag hint to avoid unnecessary iteration (re)introduced.
  3. newFcall tag reset logic removed. (It's not convenient, and blurs the lines of tag responsibility).
stevvooe commented 8 years ago

@joushou One check on the tag for negiotiation process and we're good!

kennylevinsen commented 8 years ago

I have removed that check, and added commentary that the map must not contain NOTAG (it will otherwise give an erroneous tag pool depletion error when there is still an available tag).

stevvooe commented 8 years ago

LGTM

@justincormack PTAL

justincormack commented 8 years ago

LGTM

stevvooe commented 8 years ago

@joushou Thanks for the great contribution!

Before merging, we'll need you to sign your commits.

(Sorry, normally, this is automated, but we have yet to set this up for go-p9p)

kennylevinsen commented 8 years ago

All 4 commits signed.

stevvooe commented 8 years ago

@joushou Cheers!