Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • 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
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #1966
Closed
Open
Issue created Jan 23, 2019 by Administrator@rootContributor3 of 3 checklist items completed3/3 checklist items

[BUG] Calls off multiple threads cannot run concurrently in Swift 4

Created by: DavePilks

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
Description

When creating the ResponseData object in AlamofireImplementations.swift, no dispatch queue is passed into the init. This means that Alamofire defaults to DispatchQueue.main.

If you then have multiple threads trying to make service calls, they are all placed on the main queue and cannot run concurrently as there is only a single thread.

We noticed this as we were trying to break out of the callback pattern using a semaphore. This is when we noticed the blocking.

openapi-generator version

3.3.4

Steps to reproduce

Call Setup

  • Use semaphore to block until call back is fire
  • Return result from callback

Queuing

  • Have multiple call running in the background queue

Expected Result The calls return once the call has been completed

Actual Result The calls block

Suggest a fix

The init for the Alamofire response takes in a queue parameter that is defaulted to nil. Suggested fix is to provide DispatchQueue.global(qos: .background) as the parameter to allow concurrency

Assignee
Assign to
Time tracking