Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Q quickfix
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 25
    • Merge requests 25
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • quickfixgo
  • quickfix
  • Merge requests
  • !164
An error occurred while fetching the assigned milestone of the selected merge_request.

Session event loop

  • Review changes

  • Download
  • Email patches
  • Plain diff
Administrator requested to merge github/fork/bhaan/session-msg-handling into master 9 years ago
  • Overview 4
  • Commits 3
  • Pipelines 0
  • Changes 10

Created by: bhaan

The current session event loop has a primitive approach toward handling outgoing messages sent from application code. A call to quickfix.SendToTarget essentially adds the message to a queue, which the event loop picks up during it's next pass. This is limiting for applications that want to account for a message send failure, as there is no way for the event loop to communicate that back to application code.

These commits propose the following changes:

  • Remove the toSend message queue
  • Add a dedicated channel in the event loop for sending messages.
  • Have SendToTarget push messages to the event loop, and block on a corresponding error channel
  • Force the FromAdmin/App callback to occur on a dedicated goroutine. This creates separation between "application space" and "session space", and is required to prevent deadlocks on calls to SendToTarget during the FromAdmin/App callback.
  • Separate session state message handling into three parts: 1) Vaildation 2) FromAdmin/App callback 3) Processing for admin and rejected messages. This is required to enable the above changes.
Loading
Loading

Activity


  • Administrator
    Administrator @root started a thread on commit 7850dca6 9 years ago
    session.go
    511 487 receiveTime time.Time
    512 488 }
    513 489
    490 type sendRequest struct {
    491 msg Message
    492 err chan error
    493 }
    494
    514 495 func (s *session) run(msgIn chan fixIn, msgOut chan []byte, quit chan bool) {
    496 s.messageIn = msgIn
    515 497 s.messageOut = msgOut
    498 s.toSend = make(chan sendRequest)
    499 s.resendIn = make(chan Message, 1)
    500
    501 type fromCallback struct {
    • Administrator
      Administrator @root · 9 years ago
      Author Contributor

      Created by: daino3

      any ideas on what the compiler will make of these stucts / anonymous functions getting continuously redefined from within run?

  • Administrator
    Administrator @root started a thread on commit 7850dca6 9 years ago
    session.go
    511 487 receiveTime time.Time
    512 488 }
    513 489
    490 type sendRequest struct {
    491 msg Message
    492 err chan error
    493 }
    494
    514 495 func (s *session) run(msgIn chan fixIn, msgOut chan []byte, quit chan bool) {
    496 s.messageIn = msgIn
    515 497 s.messageOut = msgOut
    498 s.toSend = make(chan sendRequest)
    499 s.resendIn = make(chan Message, 1)
    500
    501 type fromCallback struct {
    • Administrator
      Administrator @root · 9 years ago
      Author Contributor

      Created by: bhaan

      the size of golang structs I believe are just 8 bytes in addition to the types they enclose. So every time you'd call run, you'd be allocating, on the stack, 8 bytes + size of Message + size of MessageRejectError. Which is negligible considering when and how many times run is expected to be called.

  • Administrator added 1 deleted label 9 years ago

    added 1 deleted label

  • Administrator changed milestone to %v0.4.0 9 years ago

    changed milestone to %v0.4.0

  • Administrator
    Administrator @root · 9 years ago
    Author Contributor

    Merged by: cbusbey at 2016-07-11 23:01:04 UTC

  • Administrator closed 9 years ago

    closed

  • Administrator
    Administrator @root · 9 years ago
    Author Contributor

    Created by: cbusbey

    :candy: :cactus:

  • Administrator mentioned in issue #162 (closed) 9 years ago

    mentioned in issue #162 (closed)

  • Administrator mentioned in merge request !165 (merged) 9 years ago

    mentioned in merge request !165 (merged)

  • Administrator mentioned in merge request !167 (merged) 9 years ago

    mentioned in merge request !167 (merged)

  • Administrator mentioned in issue #169 (closed) 9 years ago

    mentioned in issue #169 (closed)

Please register or sign in to reply
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: github/fork/bhaan/session-msg-handling

Menu

Explore Projects Groups Snippets